Gets or sets a comparison result.
An integer value representing the comparison result.
You can use various techniques to implement custom sorting. The simplest way is to compare values of the column being sorted. You can use the CompareNodeValuesEventArgs.NodeValue1 and CompareNodeValuesEventArgs.NodeValue2 properties to access these values. More complex sorting can be implemented using the nodes that contain compared values. These nodes can be accessed via the CompareNodeValuesEventArgs.Node1 and CompareNodeValuesEventArgs.Node2 properties.
Whatever technique is used, you must set the result of comparison to the Result property. The following table contains descriptions of these property values.
|0||Compared nodes are considered as identical with respect to sorting performed. Such nodes will be located one under another without any specific order.|
|Negative||The first node is considered to have a value "less" than the second node's value. In other words, the first node will be above the second node when sorting is in ascending order. If sorting is in descending order, the first node will be located below the second.|
|Positive||The first node is considered to have a value "greater" than the second node's value. In other words, the first node will be below the second node when sorting in ascending order. If sorting in descending order, the first node will be located above the second.|
Initially, the Result property contains a value specified by the default sorting algorithm.