Rebinding / Updating while maintaining selection, position, expansion

8 posts, 0 answers
  1. Tim
    Tim avatar
    169 posts
    Member since:
    Apr 2008

    Posted 26 May 2009 Link to this post

    Hi All,

    I'm investigating Silverlight for the next revision of the product.  I'm generally quite happy with the ASP.NET Ajax controls.  One of the biggest pain points though is handling (near) real-time updates of data in RadGrid / GridView.  Right now (using the ASP.NET Ajax controls), we rebind on a manual refresh, initiated by the user, as the rebind loses the expanded detail view(s), the row selection, etc.  A quick examination by a colleague indicates this remains true with the GridView control in Silverlight.

    The behavior we want is similar to the Windows Explorer or the Task Manager - where you can select one or more items, change the sort order, etc., and not lose either while at the same time objects (files, process, tasks, etc.) can come and go and the view updates in (near) real-time.

    Anyone have any suggestions for achieving this goal?  Of course a built-in option would be best... I'd rather not keep a second, hidden grid from which I could use JS to update only individual cells, assuming that is even possible.  This approach sounds like it may slow things down even more.

    I'll cross-post this to the Silverlight GridView forum as well.

    Thank you,
    Tim

  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 29 May 2009 Link to this post

    Hello Tim,

    I think that the sample code snippets from the resources pointed below will help you retain the expanded/selected items states in flat or hierarchical grid:

    http://www.telerik.com/community/code-library/aspnet-ajax/grid/retain-expanded-selected-state-in-hierarchy-on-rebind.aspx

    http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html
    http://www.telerik.com/help/aspnet-ajax/grdpersistselectedrowsonsorting.html

    Feel free to alter/enhance the solutions presented there to be in conformance with your project schema.

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tim
    Tim avatar
    169 posts
    Member since:
    Apr 2008

    Posted 29 May 2009 Link to this post

    Thank you, Sebastian.  This was the answer I was 'afraid of'.  I was hoping there was an automatic way for this to take place.

    Do you have any way to do the same for Silverlight?  (Please answer in my cross-post in the Silverlight RadGrid forum)

    Tim

  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 29 May 2009 Link to this post

    Hello Tim,

    My colleagues from our Silvelight team will answer your question for RadGridView for Silverlight in the forum thread you opened with regards to this matter.

    Best regards,

    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Bob
    Bob avatar
    21 posts
    Member since:
    Mar 2008

    Posted 11 Oct 2009 Link to this post

    Hi Sebastian ,

    The solutions on your site work great but I can not figure how to capture when paging is fired.  This is because the same expanded row in the list stays expanded when I change pages within the grid.  Can you recommend how to know when the paging is fired and collapse all rows expanded?  Also the same collapse process when sorting or grouping changes?

    Best Regards,

    Bob

  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 12 Oct 2009 Link to this post

    Hello Bob,

    You can detect whether paging, sorting or filtering operation has been triggered on the server intercepting the ItemCommand event of the grid and checking the e.CommandName argument value in the handler. This topic from the product documentation elaborates on this subject in greater details.

    Best,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Bob
    Bob avatar
    21 posts
    Member since:
    Mar 2008

    Posted 12 Oct 2009 Link to this post

    Hey Sebastian,

    I read more indepth about the ItemCommand event which I came to realize that I am using the slider pager and when pages are changed it does not fire the ItemCommand event.  Once I change it to Next/Previous I was able to see the event triggered in ItemCommand.  I like the slider control but not sure how I can get it to trip the ItemCommand event, any direction I can go to turn on this event?

    Best Regards,

    Bob
  9. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 13 Oct 2009 Link to this post

    Hello Bob,

    Indeed your observation is correct and the slider type pager does not fire the ItemCommand event of the grid by design. However, you can wire the OnPageIndexChanged event of the grid which will be raised when you change the active page using the slider.

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017