Murray Brown
asked on
ASP.net VB.net TreeView - Loop through all nodes and child nodes
Hi. I am trying to loop through all nodes and child nodes in a TreeView.
The following code just loop through the first two levels of nodes.
I don't know how many levels there are so I need to find code that
automatically finds all nodes and TreeNodes
For i As Integer = 0 To Me.TreeViewOrg.Nodes.Count - 1
oNodeText = Me.TreeViewOrg.Nodes(i).Te xt
Next
For i As Integer = 0 To Me.TreeViewOrg.Nodes(0).Ch ildNodes.C ount - 1
oNodeText = Me.TreeViewOrg.Nodes(0).Ch ildNodes(i ).Text
Next
The following code just loop through the first two levels of nodes.
I don't know how many levels there are so I need to find code that
automatically finds all nodes and TreeNodes
For i As Integer = 0 To Me.TreeViewOrg.Nodes.Count
oNodeText = Me.TreeViewOrg.Nodes(i).Te
Next
For i As Integer = 0 To Me.TreeViewOrg.Nodes(0).Ch
oNodeText = Me.TreeViewOrg.Nodes(0).Ch
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER