Skip to main content

TdxCustomTreeView.OnCompare Event

Allows you to implement a custom node sorting.

Declaration

property OnCompare: TdxTreeViewNodeCompareEvent read; write;

Remarks

This event occurs every time two nodes are about to be compared during a sort operation.

The ANode1 and ANode2 parameters identify the nodes to be compared. Use their properties to determine their order in the sorted list. The table below explains which values you should assign to the ACompare parameter to achieve a specific node order:

Value

Description

A negative integer value

ANode1 is positioned above ANode2 in the tree.

0

ANode1 is “equal” to ANode2. Both nodes retain their positions.

A positive integer value

ANode1 is positioned below ANode2.

Refer to the TdxTreeViewNodeCompareEvent type description for an OnCompare event handler example and information on available options.

See Also