Skip to main content

CustomColumnSortEventArgs.Result Property

Gets or sets the result of a custom comparison.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public int Result { get; set; }

Property Value

Type Description
Int32

An integer value that specifies the result.

Remarks

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:

  • Set Result to -1 if the first row should be positioned above the second row when data is sorted in ascending order. When data is sorted in descending order, the first row will be positioned below the second row.
  • Set Result to 1 if the first row should be positioned below the second row when data is sorted in ascending order. When data is sorted in descending order, the first row will be positioned above the second row.
  • Set Result to 0 to indicate that the rows are equal. In this case, the rows will be arranged within the grid according to their indices in a data source.

When handling the GridControl.CustomColumnGroup event, the result should be set as shown below:

  • Set Result to 0, to indicate that the rows should be combined into the same group.
  • Set Result to 1 (or -1) to indicate that the rows should be placed in different groups.

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.

See Also