Reputation: 1312
I have a TreeView
<asp:TreeView ID="tvCategories" runat="server" ShowLines="false" ShowExpandCollapse="true" ExpandDepth="0" />
by default the list is not expended. It has a plus symbol (+) to expand the sub nodes.
when i expand the sub node and click on the sub node to show the content. once it shows the content the TreeView goes back to default state (collapses).
How do I make it stay as it was before clicking on the sub node.... expended? (keep the same state after postback)? Thanks
Upvotes: 1
Views: 4546
Reputation: 11
I post a little late but i had the same problem and i find a solution more easy:
ViewStateMode="Enabled"
in the Tree Viewif !postback
Hope that help :-)
Upvotes: 1
Reputation: 5656
what you need to do , is to persist the state of the treeview. Your state is lost as soon as the request is made. In order to persist the state of the treeview you can use one of the following
so you need to do
1: Save the treeviewstate
2: Redirect
and in exactly the same order
Upvotes: 1