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

Save the State of Expanded Nodes

1 Answer 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul Reicherdt
Top achievements
Rank 1
Paul Reicherdt asked on 08 Dec 2009, 09:58 AM
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?

Thanks,
Paul

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Dec 2009, 10:32 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.
Tags
TreeView
Asked by
Paul Reicherdt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or