ListBox.ColumnSortDirection

From Xojo Documentation

Property (As Integer )
aListBox.ColumnSortDirection(columnNumber as Integer) = newIntegerValue
or
IntegerValue = aListBox.ColumnSortDirection(columnNumber as Integer)

Supported for all project types and targets.

Used to get or set the sort direction for the passed column. The first column is numbered zero.

Notes

You set the sort direction using one of the following class constants.

Value Class Constant Description
-1 SortDescending Descending sort
0 SortNone Dont Sort
1 SortAscending Ascending sort

Example

This example sets the sort direction for a column.

ListBox1.ColumnSortDirection(2) = ListBox.SortDescending

ColumnSortDirection doesn't actually sort the rows; it only establishes the sort direction that is used when the Sort method is called. The sort direction can be set even if there is no header for the ListBox.

If you set ColumnSortDirection to SortNone, the user can't sort the column by clicking its header. SortNone will block the usual calls to the SortColumn and CompareRows events.

See Also

Sort.