Skip to main content

GridControl.SortBy(GridColumnBase, ColumnSortOrder, Int32) Method

Sorts data by the values of the specified column in the specified order, and places the column at the specified position among the sorted columns.

Namespace: DevExpress.UI.Xaml.Grid

Assembly: DevExpress.UI.Xaml.Grid.v21.2.dll

NuGet Package: DevExpress.Uwp.Controls

Declaration

public void SortBy(
    GridColumnBase column,
    ColumnSortOrder sortedOrder,
    int sortedIndex
)

Parameters

Name Type Description
column GridColumnBase

A GridColumnBase descendant that represents the column within the grid.

sortedOrder ColumnSortOrder

A ColumnSortOrder enumeration value that specifies the column’s sort order.

sortedIndex Int32

An integer value that specifies the zero-based column’s index among the sorted columns.

Remarks

The grid control allows data sorting by multiple columns. Any previous sorting is not cleared when calling the SortBy method.

End-users are allowed to sort data if the grid’s DataControlBase.AllowSorting property is set to true.

To learn more, see Sorting.

See Also