Back to Devexpress

CompareNodeValuesEventArgs.Result Property

windowsforms-devexpress-dot-xtratreelist-dot-comparenodevalueseventargs-2daee345.md

latest3.3 KB
Original Source

CompareNodeValuesEventArgs.Result Property

Gets or sets a comparison result.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
public int Result { get; set; }
vb
Public Property Result As Integer

Property Value

TypeDescription
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.

ValueDescription
0Compared nodes are considered as identical with respect to sorting performed. Such nodes will be located one under another without any specific order.
NegativeThe 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.
PositiveThe 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.

See Also

Node1

Node2

NodeValue1

NodeValue2

CompareNodeValuesEventArgs Class

CompareNodeValuesEventArgs Members

DevExpress.XtraTreeList Namespace