RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TTreeView.OnCompare Event

Occurs when two nodes must be compared during a sort of the nodes in the tree view.

Pascal
property OnCompare: TTVCompareEvent;
C++
__property TTVCompareEvent OnCompare;

Write an OnCompare event handler to customize the sort order of the nodes in the tree view. Set the Compare parameter to a value less than 0 if Node1 is less than Node2. Set Compare to 0 if Node1 is equivalent to Node2, and set Compare to a value greater than 0 if Node1 is greater than Node2. If an OnCompare event handler is not provided, tree view nodes are sorted alphabetically, based on their labels. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!