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

Using Treeview for navigation between aspx pages ?

2 Answers 74 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
johan ekman
Top achievements
Rank 1
johan ekman asked on 28 Sep 2009, 01:01 PM
Hello !
In our project I am considering using your Treeview component in several places. (for different purposes) as I like the functionality it provides. However there is one issue I need input/help on.

When using your Treeview in a Master/Content page context where the treeview component resides in the masterpage and navigates the user to different aspx pages (A very typical scenario IMO), you would loose the viewstate (because the page navigation is a GET not a POST) which would case the treeiview to loose its state each time I navigate in it. Obviously I want the treeview to keep its state between GET's (and not only postbacks which is easy enough).

Any suggestions for solving this case ? I have seen that Gaiaware treeview can persist state in cookies, is there any similar functionality on this treeview component to keep client state between GETS ?

I guess I could use page_load to find the node being loaded (finding the current node by comparing the navigation attribute of the page requested URL and then selecting it server side ?) but is this how it' supposed to be done.

Thanks, Johan

2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 28 Sep 2009, 02:22 PM
I would check out the following sample given by a Telerik team member. I think this should take care of maintaining the state with your TreeView.
0
johan ekman
Top achievements
Rank 1
answered on 28 Sep 2009, 03:14 PM
Thankyou this was excatly what I needed. I changed the example to only save the xml state on the nodeclickevent, this makes node collapsing and expanding much smoother (client side only) as I only need to save the state when a node is clicked (navigated) and not on expand/collapse.

Works like a charm.
Tags
TreeView
Asked by
johan ekman
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
johan ekman
Top achievements
Rank 1
Share this question
or