Skip to main content

TdxCustomSpreadSheet.OnCompare Event

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

Declaration

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