TcxDataControllerCompareEvent Type
The procedural type for value comparison events in a data controller.
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
AData |
Tcx |
Provides access to the data controller that raised the current value comparison event. |
ARecord |
Integer | Returns the index of the record that contains the first compared value ( The |
ARecord |
Integer | Returns the index of the record that contains the second compared value ( The |
AItem |
Integer | Returns the index of the dataset field where the current comparison operation occurs.
|
V1 | Variant | Returns the first compared value. |
V2 | Variant | Returns the second compared value. |
Compare | Integer | Specifies the comparison result ( Refer to the following section for details: Comparison Results. |
#Remarks
Handle a value comparison event to implement a custom sorting algorithm in your application. Refer to the TcxCustomDataController.OnCompare event description for a code example.
Important
Disable multi-threaded calculations for data sort operations in a data controller if your value comparison event handler is not thread-safe.
Set the Multi
#Comparison Results
The following table explains what Compare
parameter values correspond to different results of the current value comparison operation:
Compare Value | Description |
---|---|
-1 or other negative value |
V1 is treated as a smaller value than V2 ; therefore, V1 is positioned before V2 . |
0 |
V1 and V2 are considered equal. Both values retain their positions. |
1 or other positive value |
V1 is treated as a larger value than V2 ; therefore, V1 is positioned after V2 |
#Direct TcxDataControllerCompareEvent Type Reference
The TcxCustomDataController.OnCompare event references the TcxDataControllerCompareEvent
procedural type.