Persisting expanded nodes in master page

4 posts, 0 answers
  1. Antony
    Antony avatar
    10 posts
    Member since:
    Aug 2010

    Posted 07 Nov 2010 Link to this post

    I am having trouble using the treeview in a master page as everytime there is a postback the masterpage reloads and the treeview reverts to its loaded state where none of the nodes are expanded.

    I have looked on the forums here for a solution but i havent found one so far.

    Is there a solution for this?

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

    Posted 09 Nov 2010 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

  3. Scott
    Scott avatar
    1 posts
    Member since:
    Dec 2010

    Posted 09 Dec 2010 Link to this post

    Persisting the tree state in the session seems like it persists the entire tree state, not just what node is expanded, correct?  I have a situation where nodes are being added dynamically during the use of the tree view in a RadWindow, and I have successfully implemented refreshing a node so the new children show up, but the expanded state is not being maintained as these nodes expand and collapse.  Is there any javascript sample code to maintain the expanded state of nodes to accomplish this?
  4. Nikolay Tsenkov
    Nikolay Tsenkov avatar
    734 posts

    Posted 15 Dec 2010 Link to this post

    Hi Scott,

    Could you, please, post some code reproducing the problem you experience?

    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top