KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Programatically sorting columns in a listbox
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: July 23, 2008
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In a listbox, you can sort a selection by using the small triangle located next to the columns header name. The triangle pops up when you click on the column header.



Also, it is possible to control this sorting programmatically by assigning values to the header variables. For example, if you set the first column header variable equal to 1, every time you load a selection into the listbox, the selection will be sort in ascending order based on the values of the first column. All possible values are:

0: The selection is loaded by default, without sorting.
1: When selection is loaded, it is sorted in ascending order
2: When selection is loaded, the selection is sorted in descending order