Problem with maintaining treeview state

Posted by Shoyebaziz123 under ASP.NET on 7/19/2012 | Points: 10 | Views : 1921 | Status : [Member] | Replies : 0
Hi All,

I have a nested master page configuration application... firstly there is only ParentMaster with only menubar .. after selection of menu item a page with treeview must be open and selecting treeview item a second menu should be appear beneath menubar(1) , and selecting from this second menu content pages open having right side with treeview and left side with controls.

for this purpose i have created a master page with only menu , and another master page with another menu at top and left side with tree and right side with a content palce holder , setting its master page as Parentmaster . aftre selection of menu item i am filling treeview from db, then changing node from treeview i am filling second menu of nested page . then selecting menuitem from nested master page i am navigationg to diffrent pages . All of this working fine , but there is a problem that if i select Node1's child node node1 expanded then selecting menuitem navigate to page but now in this page if i expand Node3 and select its child node and the selcting menuitem Node3 is collapsed ( which must be expanded) and Node 1 is expanded(ok) .
I have wittenn the code for saving treeview state like this

private void SaveTreeViewState(TreeNodeCollection nodes, List<string> list)
// Recursivley record all expanded nodes in the List.
foreach (TreeNode node in nodes)
if (node.ChildNodes != null && node.ChildNodes.Count != 0)
if (node.Expanded.HasValue && node.Expanded == true && !String.IsNullOrEmpty(node.Text))
SaveTreeViewState(node.ChildNodes, list);

( there is also code for restoring state)

while i am debugging from content page after clicking Node3 the conditon " node.Expanded == true " is showing false which must be true
although i have expanded the node ...

what i have to do now ?



(No response found.)

Login to post response