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

Expanding selected node in depth after refreshing page

3 Answers 290 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yano
Top achievements
Rank 1
Yano asked on 16 Jul 2010, 02:12 PM
Hi telerik team member,
I have been searching trought forum and over web for a example with no result. So here is my problem.
After refreshing page all the nodes in RadTreeview are collapsed, I need to manage treeview that selected node every refresh of page or postback is expanded in depth (for Client-side).
Thanks for any advice

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jul 2010, 07:21 AM
Hello Yano,


I tried the scenario and RadTreeView (RadControls Version 2010, 1, 519, 35) keeps the expanded state even after postback (as illustrated in demo). Probably the following code library will be of help if you are using older version of RadControls.
Save the expanded state of the TreeNodes when the treeview is being bound upon each postback


-Shinu.
0
Yano
Top achievements
Rank 1
answered on 19 Jul 2010, 09:17 AM
Thanks for answer,
I need to explain my problem in more detail. In my scenario i have treeview on masterpage, after clicking on treeview node redirect me to content page. After selected content page is reloaded, position of the selected node has been lost and all treeview nodes are collapsed. 
I need to find out the right way to "save" the selected node state before reloading page and after that expand the parent node(s) and select the selected node.
0
Shinu
Top achievements
Rank 2
answered on 20 Jul 2010, 02:24 PM
Hi Yano,


One suggestion is that to use the GetXML() method to get the current state of RadTreeView as XML string and save the XML string (like save in Session variable). 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

-Shinu.
Tags
TreeView
Asked by
Yano
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Yano
Top achievements
Rank 1
Share this question
or