Update sorting in grid when data has changed

5 posts, 0 answers
  1. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 14 Feb 2011 Link to this post

    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
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 15 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 15 Feb 2011 Link to this post

    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
  5. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 15 Feb 2011 Link to this post

    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...
  6. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 15 Feb 2011 Link to this post

    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>>
Back to Top
DevCraft banner