Home Forums WPF controls Xceed DataGrid for WPF Sorting programmatically

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23806 |

    Is there some way to programmatically invoke the same logic that runs when the user clicks on a ColumnHeader to sort a column? Based on the value in a dropdown, I’m binding to ObservableCollections of varying types and I’d like to set and maintain the sort when I’m adding the columns at run-time.

    Imported from legacy forums. Posted by Lori (had 497 views)

    Xceed Support
    Member
    Post count: 5658

    You can affect the DataGridControl.Items.SortDescriptions property with new SortDescription items.

    Alternately, you could proceed with doing the same thing directly on the DataGridCollectionView and/or CollectionView ( or the data source directly, if it supports sorting).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2607 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.