Type | Description | |||
SortOrderEnum | A SortOrderEnum expression that indicates the column's sort order. |
The control automatically sorts a column when the user clicks the column's header, if the SortOnClick property is exDefaultSort. If the SortOnClick property is exNoSort, the control disables sorting the items when the 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. The SortOrder property displays the sorting icon in the column's header if the DisplaySortIcon property is True:
ComboBox1.Columns(ColIndex).SortOrder = SortAscending
Using the SortChildren method of the Items object. The SortChildren sorts the items. The SortChildren method sorts the child items of the given parent item in the control. SortChildren will not recourse through the tree, only the immediate children of Item will be sorted. The following sample sort descending the list of root items on the "Column 1"( if your control displays a list, all items are considered being root items ).
ComboBox1.Items.SortChildren 0, "Column 1", False