Skip to main content

GridColumn.SortMode Property

Gets or sets whether the grid should sort or group data by column values or display text. This is a bindable property.

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

Declaration

public DataSortMode SortMode { get; set; }

Property Value

Type Description
DataSortMode

A value that specifies how to sort column values.

Available values:

Name Description
Default

Sorts the data according to the type of the editor assigned to the column.

Value

Sorts the column data by the column’s edit values (these are synchronized with the bound data source’s values).

DisplayText

Sorts the column data by the column’s display text (that are strings displayed in column cells).

Custom

Indicates that a custom algorithm is used to sort data. To implement the custom sort algorithm for a grid, handle its CustomSort event. In the DataGridView, the Custom mode also enables custom grouping for rows. To implement a custom group algorithm, handle the CustomGroup event.

Remarks

The following example enables sorting by values in a grid column:

<dxg:DataGridView.Columns>
    <dxg:TemplateColumn FieldName="Name" SortMode="Value">
         <!--...-->
    </dxg:TemplateColumn>
</dxg:DataGridView.Columns>
See Also