Type | Description | |||
SortOnClickEnum | A SortOnClickEnum expression that indicates the action that control takes when user clicks the column's header. |
There are two methods to get the items sorted like follows:
Using the SortOrder property of the Column object::
List1.Columns(ColIndex).SortOrder = SortAscending
The SortOrder property adds the sorting icon to the column's header, if the DisplaySortIcon property is True.
Using the Sort method of the Items collection. The Sort sorts the items. The following sample sorts descending the list of items on the "Column 1".
List1.Items.Sort "Column 1", False
The control fires the Sort event when the control sorts a column ( the user clicks the column's head ) or when the sorting position is changed in the control's sort bar. Use the Sort event to sort the data when the SortOnClk property is exUserSort