Search code examples
c#wpfsortingc#-4.0wpfdatagrid

How to remove wpf grid sort arrow after clearing sort descriptions


I click on a grid header to sort a column and then click a "Reset" button to clear the sort descriptions through its collection view. But the sort arrow icon still persists in the header. How to remove it?


Solution

  • simple solution i can think of is

    foreach (DataGridColumn column in DataGridView.Columns)
    {
        column.SortDirection = null;
    }