CompareNodeValuesEventArgs.Result Property
Gets or sets a comparison result.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v24.2.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList
#Declaration
#Property Value
Type | Description |
---|---|
Int32 | An integer value representing the comparison result. |
#Remarks
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.
Value | Description |
---|---|
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.