Skip to main content

TcxMCListBox.Sorted Property

Specifies whether items of the list box are alphabetically sorted.

Declaration

property Sorted: Boolean read; write; default False;

Property Value

Type Default
Boolean False

Remarks

Set the Sorted property to True to sort items of the list box alphabetically. Note that items are sorted in ascending order. Changing item contents or adding new items to the list forces the control to resort items. Note that entire strings stored within the Items property are compared to implement sorting. So, if the first column contains the same values, the order of these items is determined by the contents of the following columns. Also note, that setting the Sorted property to True changes the order of items within the Items collection.

If the Sorted property is False, items are not sorted. New items can be added to any position within the collection. Note however, that setting the Sorted property to False after it was set to True doesn’t change the order of items to the initial state.

Also note, that when the Sorted property value is False, you can allow end-users to sort items by any column value. To implement this, you must set the AllowClick property of TcxHeaderSection objects representing header sections to True. These objects can be accessed via the HeaderSections property. If this has been performed, end-users can click column headers to sort items against values of the column. The first click applies sorting in ascending order. Following clicks toggle sort order. When sorted, column headers display special images identifying current sort order. See the image below for clarification.

Sorting the list box by clicking column headers also changes the order of items in the Items collection.

The default value of the Sorted property is False.

See Also