I think this is common usage in treeview, the treeview has a number of level, and I have a path say Level1 > Level2> Level3> Level4
How can I expand the treeview to Level 4 by using the path? any build in function?
Thanks.
I think this is common usage in treeview, the treeview has a number of level, and I have a path say Level1 > Level2> Level3> Level4
How can I expand the treeview to Level 4 by using the path? any build in function?
Thanks.
Purely based on documentation
TreeNode mynode = treeView1.FindNode(pathToNode);
mynode.Select();
mynode.Expand();
I hope you get the starting point from here.
Dim n As System.Web.UI.WebControls.TreeNode = Me.tree.FindNode("Root/Parent 2/Child 2")
ExpandPath(n)
Private Shared Sub ExpandPath(ByVal node As System.Web.UI.WebControls.TreeNode)
If Not node.Parent Is Nothing Then
node.Expand()
ExpandPath(node.Parent)
Else
node.Expand()
End If
End Sub