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

Update sorting in grid when data has changed

4 Answers 185 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Licenses
Top achievements
Rank 1
Licenses asked on 14 Feb 2011, 05:16 PM
Hello,

I have a telerik radgridview that is bound to a QueryableDomainServiceCollectionView in a ViewModel. The QueryableDomainServiceCollectionView has a sortdescriptor on a field called SequenceNumber. The user can change the sequencenumber of the selected item, by clicking up- and downbuttons. When I save the context after an item has been moved, the gridview is refreshed and the item has indeed moved to the correct position.

Is there a way to re-apply sorting without having to perform a submit of the context? Back in the old days, when we were working with ObservableCollections, we just had to notify the gridview via a PropertyChanged event on the observable collection. How do i do this with a QueryableDomainServiceCollectionView? PropertyChanged event doesn't seem to do the trick.

Thank you,
Sodi

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 15 Feb 2011, 08:16 AM
Hello Sodi We,

Can you try calling the Rebind method of the grid and see how it goes?

Another option would be to remove and re-add the SortDescriptor. This should resort the grid.

Let us know if these do not help.

Regards,
Ross
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Licenses
Top achievements
Rank 1
answered on 15 Feb 2011, 09:41 AM
These two options don't seem to do the trick. I think the problem is that as soon as the context has changes, rebinding the grid, or re-sorting doesn't seem to work. Also important to state is that the grid is a paged grid with a RadDataPager bound to the same QueryableDomainServiceCollectionView.

Any other options?

Kind regards,
Sodi We
0
Licenses
Top achievements
Rank 1
answered on 15 Feb 2011, 10:02 AM
I've also tried to set the QueryableDomainServiceCollectionView to which the grid is bound to null, and then set it back to its old value and re-applying sorting, filtering and grouping. Still no success...
0
Rossen Hristov
Telerik team
answered on 15 Feb 2011, 12:12 PM
Hi Sodi We,

That is weird. In this case, could you please open a separate support ticket and attach a sample project with your exact configuration. I will try to come up with some kind of workaround for your case.

Thanks in advance.

All the best,
Ross
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
DomainDataSource
Asked by
Licenses
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Licenses
Top achievements
Rank 1
Share this question
or