method Items.SortChildren (Item as HITEM, ColIndex as Variant, Ascending as Boolean)

Sorts the child items of the given parent item in the control.

   Item as HITEM A long expression that indicates the item's handle.  
   ColIndex as Variant A long expression that indicates the column's index, a string expression that indicates the column's caption.  
   Ascending as Boolean A boolean expression that defines the sort order.  

SortChildren will not recurse through the ComboBox, only the immediate children of item will be sorted. If your control acts like a simple list you can use the following line of code to sort ascending the list by first column: ComboBox1.Items.SortChildren 0, 0. To change the way how a column is sorted use SortType property of Column object. The SortChildren property doesn't display the sort icon on column's header.  The control automatically sorts the children items when user clicks on column's header. Use the SortOnClick property to disable sorting columns by clicking in the columns header. Use the SortOrder property to get the column sorted and to display the sorting icon in the column's header. Use the AllowSort property to avoid sorting a column when the user clicks the column.

Send comments on this topic.
1999-2018 Exontrol.COM, Software. All rights reserved.