Is there a way to sort a WPF DataGrid programmaticaly ( for example, like if i clicked on my first column).
Is there a way to simuate this click ? Or a best way ?
Fast & Easy way:
dgv.Items.SortDescriptions.Clear(); dgv.Items.SortDescriptions.Add(new SortDescription("ID", ListSortDirection.Descending)); dgv.Items.Refresh();