Home › Forums › WPF controls › Xceed DataGrid for WPF › Sorting for DataGrid Columns
Can I set the sort order for the DataGrid Columns from code-behind?
The Property SortDirection only has a Getter, is there a way to work around this?
Imported from legacy forums. Posted by Serene (had 393 views)
If you are using the DataGridCollectionView (recommended) then you can add the desired SortDescription structs to its SortDescriptions collection.
If you are not using the DataGridCollectionView, you can add the SortDescription structs directly to the grid’s Items.SortDescriptions collection.
Imported from legacy forums. Posted by Jenny [Xceed] (had 2857 views)