Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,


i am using a treeview in which i want treeview is collapse when it is first time page load and when we expand any node then it will expand while page is refresh.


how to solve this???

thank u
Posted
Comments
BobJanova 21-Feb-12 14:28pm    
Which treeview control are you using? Have you checked its documentation? (chances are it has expand/contract methods in some form).
Dean Oliver 22-Feb-12 14:49pm    
What control. jquery, asp.net???
Niral Soni 22-Feb-12 16:17pm    
The basic rule for this is to store the state of every tree node at the time of refresh (either using url parameters or localStorage concept) and to re-apply those stored values back to the treeview to expand it.

For example,
step 1) webpage opened for the first time (treeview is in collapse form)
step 2) expanding one or more treenodes (also, preseving all those nodes that are expanded)
step 3) browser is refreshed because of some user action / event (passing all the preserved values to the request so as to get it back after refresh or storing the values in cookies or localStorage)

Thanks & regards,
Niral Soni

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900