Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomTreeView.OnCompare Event

In This Article

Allows you to implement a custom node sorting.

#Declaration

Delphi
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