Partial Refresh of Self Referencing GridView hierarchy

2 posts, 1 answers
  1. Alexis
    Alexis avatar
    1 posts
    Member since:
    Jan 2011

    Posted 04 Apr 2016 Link to this post

    I am looking to be able to change the structure of the parent child relationship in a self-referencing hierarchy without losing the currently expanded hierarchy not related to the rows/nodes being removed and replaced.

    I successfully have the ParentId and Id relationship displaying as a hierarchy in the grid view by using a BindingList<RowItemWithParentChildRelationship> bound to the DataSource of the RadGridView property.

    However when I remove the old rows/nodes that no longer apply and then add the new rows/nodes (to the BindingList<>) to be displayed the radgrid control only displays the old rows being removed and not the new rows that have subsequently replaced the old structure without offering the ability to expand into the new structure.

    Am I missing a trick to reparse the hierarchy (without losing the entire expand context) and display the newly added items in the hierarchy?

    I can update the DataSource property which off course rebuilds all rows and loses the currently expanded tree but if it is at all possible to avoid this it will make for a much better user experience.

    Digging around the available properties of RadGridView I've tried calling,


    which I had hoped would reparse the bound data into the tree structure and offer the expansion into the replaced children of the parent node in question but to no avail.

    Many thanks in advance.

  2. Answer
    Hristo avatar
    1028 posts

    Posted 05 Apr 2016 Link to this post

    Hello Alexis,

    Thank you for writing.

    I believe that you could achieve your task by saving the state of the expanded rows and after you change the data source object restore it. 

    I am sending you attached a sample project which I hope could fit your local setup.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Hristo Merdjanov
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top