This is a migrated thread and some comments may be shown as answers.

Binding SortDescriptors

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
haagel
Top achievements
Rank 1
haagel asked on 25 Oct 2010, 04:10 PM

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

3 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 25 Oct 2010, 04:15 PM
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
0
haagel
Top achievements
Rank 1
answered on 25 Oct 2010, 04:48 PM
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. :)
0
Yavor Georgiev
Telerik team
answered on 25 Oct 2010, 04:56 PM
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
Tags
GridView
Asked by
haagel
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
haagel
Top achievements
Rank 1
Share this question
or