TcxCustomTreeView.SortType Property
Specifies the type of sorting applied to tree view control nodes
#Declaration
property SortType: TSortType read; write; default stNone;
#Property Value
Type | Default |
---|---|
TSort |
st |
#Remarks
Use the SortType property to sort tree view control nodes and specify when they need to be resorted. The following values are available for this property.
Value | Meaning |
---|---|
st | Specifies that sorting is not applied tree view nodes. This means that the control will not automatically resort nodes until the Sort Changing the Sort |
st | Specifies that tree view nodes are sorted by their captions in ascending order. Each time the caption of a node is changed, nodes are resorted. To toggle sort order, call the Alpha You can implement custom sorting logic by handling the On |
st | Setting the Sort Set the Sort |
st | This value implies that node sorting takes place each time the Text or Data property of a node is changed. The sorting logic must be implemented in the On |
You may need to use a sorting procedure that uses custom node settings (other than the Text or Data property) to perform sorting. In this instance, you must leave the SortType property set to stNone to disable automatic node restoration when changing the mentioned properties. When settings used in your sorting algorithm are changed or nodes are added to the tree view, you must manually call the AlphaSort method. Use the OnAddition method to provide a response to node addition.
Please refer to the OnCompare method description for an example of performing custom node sorting.
Warning
When nodes are sorted, their indexes within the tree view are changed. Thus accessing nodes by indexes after sorting may lead to errors.
The default value of the SortType property is stNone.