Binding SortDescriptors

4 posts, 0 answers
  1. haagel
    haagel avatar
    52 posts
    Member since:
    Feb 2010

    Posted 25 Oct 2010 Link to this post

    I'm using the MVVM pattern for my application.

     

    Is it possible to bind the SortDescriptors collection of a RadGridView to a list in my viewmodel, and if so how do I do that?

     

    Creating a property of type SortDescriptionCollection in my viewmodel is easy, but I don't know how to bind the gridview to that.

     

    Thanks // David

  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 25 Oct 2010 Link to this post

    Hello David Haglund,

     You can do two things: you can either expose your data through a property of type QueryableCollectionView on your ViewModel, which has SortDescriptors, GroupDescriptors, etc., which will be directly used by the RadGridView and which you can modify yourself from your ViewModel, or you can adapt this approach to your scenario.

    Best wishes,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. haagel
    haagel avatar
    52 posts
    Member since:
    Feb 2010

    Posted 25 Oct 2010 Link to this post

    Hi Yavor!

    Let me see if I understand you correctly...

    This QueryableCollectionView... should I have a property of that type in my viewmodel and bind the ItemsSource of the gridview to that?

    Your other solution, the one in the blogpost, also seems interesting. :)
  5. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 25 Oct 2010 Link to this post

    Hello David Haglund,

     Your understanding is correct, that is exactly how it is used in this scenario.

    Kind regards,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top