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

TdxCustomShellListView.OnCompare Event

In This Article

Allows you to implement a custom shell item sorting algorithm.

#Declaration

Delphi
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