Skip to main content
All docs
V23.2

SortArgs.Result Property

Gets or sets the result of a custom comparison.

Namespace: DevExpress.Mvvm.Xpf

Assembly: DevExpress.Mvvm.v23.2.dll

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

Declaration

public int? Result { get; set; }

Property Value

Type Description
Nullable<Int32>

The result of a custom comparison.

Remarks

To apply custom sort or group operations, compare two rows and assign the result of the comparison to the Result property. The FirstValue and SecondValue parameters identify the values of these rows in the FieldName column.

When you execute a command bound to the GridControl.CustomColumnSortCommand and TreeListView.CustomColumnSortCommand properties, set the result as follows:

  • -1 to position the first row above the second row when data is sorted in ascending order. When data is sorted in descending order, the GridControl positions the first row below the second row.

  • 1 to position the first row below the second row when data is sorted in ascending order. When data is sorted in descending order, the GridControl positions the first row above the second row.

  • 0 to indicate that the rows are equal. In this case, the GridControl arranges rows according to their indices in a data source.

When you execute a command bound to the GridControl.CustomColumnGroupCommand property, set the result as follows:

  • 0 to combine the rows into the same group.
  • 1 (or -1) to place the rows 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