Skip to main content

TcxCustomPivotGrid.OnCompare Event

Fires when the sorting operation on column field values or row field values is performed.

Declaration

property OnCompare: TcxPivotGridCompareEvent read; write;

Remarks

Implement the OnCompare event handler to provide the custom comparator for the AValue1 and AValue2 values.

The Sender parameter specifies the pivot grid, which the sorting operation is processed for.

The AField parameter specifies the field, which owns the values to be compared.

The AValue1 and AValue2 parameters specify the values to be compared.

The Compare parameter specifies the result of comparison. If sorting in ascending order, the parameter should take the following values:

Value Description
1 AValue1 is greater than AValue2.
0 AValue1 and AValue2 are equal.
-1 AValue1 is less than AValue2.

For descending order reverse the sign.

Note

The OnCompare event fires only in standard data binding modes. In OLAP mode, the sorting operation is performed as specified by the dimension SortMode property settings.

See Also