This is a migrated thread and some comments may be shown as answers.

Persisting expanded nodes in master page

3 Answers 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 07 Nov 2010, 09:13 PM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Nov 2010, 07:45 AM
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


-Shinu.
0
Scott
Top achievements
Rank 1
answered on 09 Dec 2010, 09:07 PM
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?
0
Nikolay Tsenkov
Telerik team
answered on 15 Dec 2010, 12:50 PM
Hi Scott,

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


Regards,
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.
Tags
TreeView
Asked by
Antony
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Scott
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Share this question
or