Tree View in ASP.NET
-
hi........ we are working on tree view but the problem is tree view is expands every node but i want only one node expands every time, mean if already one node is expanded then we try to expand another then automatically other nodes are collapsed .. Waiting for Response ..............
Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com
-
hi........ we are working on tree view but the problem is tree view is expands every node but i want only one node expands every time, mean if already one node is expanded then we try to expand another then automatically other nodes are collapsed .. Waiting for Response ..............
Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com
Not very clear on what you want. So if one node is expanded already and if you try to expand another node, then do you require all the remaining open nodes should be collapsed or it should remain open?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
-
Not very clear on what you want. So if one node is expanded already and if you try to expand another node, then do you require all the remaining open nodes should be collapsed or it should remain open?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
yes..... all the remaining open nodes should be collapsed
Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com
-
hi........ we are working on tree view but the problem is tree view is expands every node but i want only one node expands every time, mean if already one node is expanded then we try to expand another then automatically other nodes are collapsed .. Waiting for Response ..............
Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com
So capture the open event, and close all the other nodes in code.
Christian Graus Driven to the arms of OSX by Vista.
-
yes..... all the remaining open nodes should be collapsed
Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com
You could achieve this easily by using the CollapseAll method from the tree view and then, on the clicked node you could do thisNode.Expanded = true, and recursively do this for all the parents he has using the Parent property. For instance,
youTree.CollapseAll();
.. on the event
TreeNode currentNode = nodeFromEvent;
while(currentNode != null)
{
currentNode.Expanded = true;
currentNode = currentNode.Parent;
}______________________ Dominic Goulet FroggedSoft My blog