Home Forums WPF controls Xceed DataGrid for WPF Select a sort column with C#

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

    Is it possible to select a column as sorted column with C# ?

    Imported from legacy forums. Posted by Bernard (had 375 views)

    Xceed Support
    Member
    Post count: 5658

    myDataGridCollectionView.SortDescriptions.Clear();

    myDataGridCollectionView.SortDescriptions.Add( new SortDescription( myColumn.FieldName, ListSortDirection.Ascending) );

    Note: If you don’t have direct access to your DataGridCollectionView instance ( i.e. going through a DataGridCollectionViewSource), you can either do the same thing with the DataGridCollectionViewSource object or the DataGridControl.Items property.

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

    User (Old forums)
    Member
    Post count: 23064

    It’s work very well. 😀

    Thank very much for your fast response.

    Imported from legacy forums. Posted by Bernard (had 3512 views)

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