wpf-devexpress-dot-xpf-dot-grid-dot-customcolumnsorteventargs-1da38376.md
Gets or sets the result of a custom comparison.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public int Result { get; set; }
Public Property Result As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the result.
|
Use the Result property to set the result of the custom comparison of the two rows being processed. The compared values are returned by the CustomColumnSortEventArgs.Value1 and CustomColumnSortEventArgs.Value2 properties.
When handling the GridControl.CustomColumnSort event, the result must be set as follows:
When handling the GridControl.CustomColumnGroup event, the result should be set as shown below:
The following code snippets (auto-collected from DevExpress Examples) contain references to the Result property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-data-grid-implement-custom-grouping/CS/CustomGrouping_CodeBehind/MainWindow.xaml.cs#L44
double y = Math.Floor(Convert.ToDouble(e.Value2) / 10);
e.Result = x > 9 && y > 9 ? 0 : x.CompareTo(y);
e.Handled = true;
wpf-data-grid-implement-custom-sorting/CS/CustomSorting_CodeBehind/MainWindow.xaml.cs#L44
int dayIndex2 = GetDayIndex(e.Value2);
e.Result = dayIndex1.CompareTo(dayIndex2);
e.Handled = true;
wpf-data-grid-implement-custom-grouping/VB/CustomGrouping_CodeBehind/MainWindow.xaml.vb#L44
Dim y As Double = Math.Floor(Convert.ToDouble(e.Value2) / 10)
e.Result = If(x > 9 AndAlso y > 9, 0, x.CompareTo(y))
e.Handled = True
wpf-data-grid-implement-custom-sorting/VB/CustomSorting_CodeBehind/MainWindow.xaml.vb#L51
Dim dayIndex2 As Integer = Me.GetDayIndex(e.Value2)
e.Result = dayIndex1.CompareTo(dayIndex2)
e.Handled = True
See Also
CustomColumnSortEventArgs Class