Back to Devexpress

DataGridView.ClearSorting() Method

maui-devexpress-dot-maui-dot-datagrid-dot-datagridview-8d7799a1.md

latest1.5 KB
Original Source

DataGridView.ClearSorting() Method

Clears the sorting applied to the grid.

Namespace : DevExpress.Maui.DataGrid

Assembly : DevExpress.Maui.DataGrid.dll

NuGet Package : DevExpress.Maui.DataGrid

Declaration

csharp
public void ClearSorting()

Remarks

The ClearSorting method removes sorting applied to all columns. To clear sorting by a specific column, set the column’s GridColumn.SortOrder property to ColumnSortOrder.None.

The following example shows how to clear sorting when a user clicks the Clear Sorting button:

xaml
<Grid RowDefinitions="100, *">
    <Button Grid.Row="0" 
            Text="Clear Sorting" 
            Clicked="Button_Clicked"/>
    <dxg:DataGridView Grid.Row="1" 
                      x:Name="Grid" 
                      SortMode="Multiple">
        <!--...-->
    </dxg:DataGridView>
</Grid>
csharp
private void Button_Clicked(object sender, EventArgs e) {
    Grid.ClearSorting();
}

See Also

DataGridView Class

DataGridView Members

DevExpress.Maui.DataGrid Namespace