Back to Devexpress

GridControl.SortBy(GridColumn) Method

wpf-devexpress-dot-xpf-dot-grid-dot-gridcontrol-dot-sortby-x28-devexpress-dot-xpf-dot-grid-dot-gridcolumn-x29.md

latest2.8 KB
Original Source

GridControl.SortBy(GridColumn) Method

Sorts data against the specified column.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public void SortBy(
    GridColumn column
)
vb
Public Sub SortBy(
    column As GridColumn
)

Parameters

NameTypeDescription
columnGridColumn

A column within the GridControl.

|

Remarks

The GridControl allows you to sort data against multiple columns. Call the SortBy method to apply a new sort condition. The GridControl creates a new GridSortInfo object that stores sort parameters, and appends this object to the GridSortInfoCollection. The sort operation result depends on the order of the applied conditions within the collection. If the GridSortInfoCollection already contains a sort condition for the specified column, the GridControl replaces this condition with a new condition.

The SortBy(GridColumn) method sorts data in ascending order. To specify the sort order or sort condition index within the GridSortInfoCollection, call the SortBy(GridColumn, ColumnSortOrder) and SortBy(GridColumn, ColumnSortOrder, Int32) methods, respectively.

Refer to the following topics for more information: Sorting in Code and Sort Data.

See Also

SortInfo

ClearSorting()

Sorting

GridControl Class

GridControl Members

DevExpress.Xpf.Grid Namespace