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

TdxCustomSpreadSheet.OnCompare Event

In This Article

Enables you to implement the custom comparator for the sorting the cell data.

#Declaration

Delphi
property OnCompare: TdxSpreadSheetViewCompareValuesEvent read; write;

#Remarks

This event is fired in response to calling the Table View worksheet’s SortByColumnValues and SortByRowValues procedures.

The Sender parameter specifies a generic worksheet object that corresponds to a sheet in which the sorting operation is performed.

The AData1 and AData2 parameters specify two cell values compared during a sorting operation.

The Compare parameter is used to return the comparison result. If the sorting operation is performed in ascending order, this parameter assumes one of the following values:

Value Description
1 AData1 is greater than AData2
0 AData1 and AData2 are equal
-1 AData1 is less than AData2

For sorting in descending order reverse the sign.

See Also