Click here to Skip to main content
16,014,860 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

can anyone please tell me how to maintain the state(expanded or collapsed) of treeview nodes after reloading in c#?

Thanks in advance.
Posted
Updated 19-Jan-11 19:21pm
v2

You will need to write treeview state in a temporaray file or the database and retrieve these values when the form / program is loaded again.
 
Share this answer
 
That's simple to save it's state, Just follow tha way HERE[^], Once you have stored state in Dictionary object then store that object permanantly using Serialization[^], Once page is loaded again, DeSerialize object back and Load tree view again from it.
 
Share this answer
 
v2

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