Back to Devexpress

TdxCustomListView.OnCompare Event

vcl-dxlistview-dot-tdxcustomlistview-e03bb8bf.md

latest1.1 KB
Original Source

TdxCustomListView.OnCompare Event

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:

ValueDescription
A negative integer valueAItem1 is positioned before AItem2.
0AItem1 is positioned before AItem2.
A positive integer valueAItem is positioned after AItem2.

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

See Also

TdxCustomListView Class

TdxCustomListView Members

dxListView Unit