Skip to main content

TdxCustomShellListView.OnCompare Event

Allows you to implement a custom shell item sorting algorithm.

Declaration

property OnCompare: TcxShellCompareEvent read; write;

Remarks

The Shell List View control lists folders followed by files and then sorts the folders and files independently in alphabetical order during a sort operation. The OnCompare event occurs every time the control compares two shell items to determine their relative position in the full list.

Handle the OnCompare event to customize the shell item order after a sort operation. The AItem1 and AItem2 parameters identify the compared shell items within the event handler. Use their properties to determine their order in the sorted list. The table below explains the 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 Both items are treated as equal; their positions do not change.
A positive integer value. AItem1 is positioned after AItem2.

Refer to the TcxShellCompareEvent procedural type description for an OnCompare event handler and detailed information on available options.

See Also