D
David Jackson
Hello,
I have a TreeView control with "top-level" nodes and "second-level" nodes
(probably not the correct terms) as follows:
objNode = new TreeNode();
objNode.Text = "2006";
objNode.SelectAction = TreeNodeSelectAction.Expand;
tvSide.Nodes.Add(objNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·January";
objChildNode.NavigateUrl = "../2006/jan.aspx";
objNode.ChildNodes.Add(objChildNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·February";
objChildNode.NavigateUrl = "../2006/feb.aspx";
objNode.ChildNodes.Add(objChildNode);
// other child nodes for 2006
objNode = new TreeNode();
objNode.Text = "2007";
objNode.SelectAction = TreeNodeSelectAction.Expand;
tvSide.Nodes.Add(objNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·January";
objChildNode.NavigateUrl = "../2007/jan.aspx";
objNode.ChildNodes.Add(objChildNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·February";
objChildNode.NavigateUrl = "../2007/feb.aspx";
objNode.ChildNodes.Add(objChildNode);
When I click on the 2006 node, it correctly expands to reveal the nodes
underneath it.
But, if I then click on the 2007 node, I would like it to "close up" the
2006 node as well as expanding the 2007 node. Is there a way to do this?
Thank you.
DJ
I have a TreeView control with "top-level" nodes and "second-level" nodes
(probably not the correct terms) as follows:
objNode = new TreeNode();
objNode.Text = "2006";
objNode.SelectAction = TreeNodeSelectAction.Expand;
tvSide.Nodes.Add(objNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·January";
objChildNode.NavigateUrl = "../2006/jan.aspx";
objNode.ChildNodes.Add(objChildNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·February";
objChildNode.NavigateUrl = "../2006/feb.aspx";
objNode.ChildNodes.Add(objChildNode);
// other child nodes for 2006
objNode = new TreeNode();
objNode.Text = "2007";
objNode.SelectAction = TreeNodeSelectAction.Expand;
tvSide.Nodes.Add(objNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·January";
objChildNode.NavigateUrl = "../2007/jan.aspx";
objNode.ChildNodes.Add(objChildNode);
objChildNode = new TreeNode();
objChildNode.Text = " ·February";
objChildNode.NavigateUrl = "../2007/feb.aspx";
objNode.ChildNodes.Add(objChildNode);
When I click on the 2006 node, it correctly expands to reveal the nodes
underneath it.
But, if I then click on the 2007 node, I would like it to "close up" the
2006 node as well as expanding the 2007 node. Is there a way to do this?
Thank you.
DJ