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

TdxCustomListView.OnCompare Event

In This Article

Allows you to implement a custom item sort.

#Declaration

Delphi
property OnCompare: TdxListViewCompareEvent read; write;

#Remarks

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

The AItem1 and AItem2 parameters identify the items 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 item order:

Value Description
A negative integer value AItem1 is positioned before AItem2.
0 AItem1 is positioned before AItem2.
A positive integer value AItem is positioned after AItem2.

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

See Also