Save the State of Expanded Nodes

2 posts, 0 answers
  1. Paul Reicherdt
    Paul Reicherdt avatar
    1 posts
    Member since:
    Dec 2009

    Posted 08 Dec 2009 Link to this post

    Hi all,

    i have the following problem: I create the TreeView programmatically as a part of composite control and bind my data in CreateChildControls method. After PostBack on ContextMenu my Tree collapses all nodes and don't save the expand state.

    How can i let the tree to save the state?
    Is it only possible via session or viewstate?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Dec 2009 Link to this post

    Hi Paul,

    One suggestion is that to use the GetXML() method to get the current state of RadTreeView as XML string and save the XML string. When you decide to restore your Treeview call the LoadXmlString() method to populate the treeview from the previously stored XML String. Please refer the forum link which discusses similar scenario.
    RadTreeView save expanded state

    Also checkout the code library: Save the expanded state of the TreeNodes when the treeview is being bound upon each postback

Back to Top