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

CollectionViewSource as ItemsSource

2 Answers 228 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tyree
Top achievements
Rank 2
Tyree asked on 19 Jul 2010, 10:10 PM
Moving from DataGrid to RadGridView we have a problem with RadGridView's behavior with CollectionViewSource.View as its ItemsSource. Previously when we defined a SortDescription on the CVS it showed in the DataGrid, then if you changed the sorted column in the DataGrid it would reflect in the CVS. RadGridView does show the column I default, but when I change the sort through the UI it does not update the CVS with the currently sorted columns.

The RadGridView also seems to handle things strangely with the CVS that causes errors when adding a SortDescription to a CVS that has its Source defined.

So...I don't have to use a CVS, but I need something to define the sort via the VM as we don't have (and will not have) a handle on our V. What options do I have with a RadGridView to be able to define groupings and sorts in the collection the grid is bound to if a CVS doesn't work quite right? Or...what am I doing wrong with the CVS :)

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvyatko
Telerik team
answered on 20 Jul 2010, 02:50 PM
Hi Tyree,

I have prepared simple project demonstrating how RadGridView will behave when it is bind using CollectionViewSource. As it uses CVS View as ItemsSource, it is essential to update the sort and group data through the View, rather than CollectionViewSource, otherwise it can produce unexpected results.

Please have a look at the attachment and let me know if this helps in your case.

If you have any other issues or questions do not hesitate to contact us.

Kind regards,
Tsvyatko
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
Tyree
Top achievements
Rank 2
answered on 21 Jul 2010, 02:00 PM
Indeed the issues I experienced are only present if I add sort descriptions to the CVS instead of the CVS.View. Interesting.

Thank you.
Tags
GridView
Asked by
Tyree
Top achievements
Rank 2
Answers by
Tsvyatko
Telerik team
Tyree
Top achievements
Rank 2
Share this question
or