By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,975 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,975 IT Pros & Developers. It's quick & easy.

Treeview - Recursive Search

P: n/a
Hi,
I am doing a recursive search of my treeview. All I am doing is iterating
through the nodes and checking if my tag = my id. It seems to works, finds
the ID, selects it and exits. However, it seem to add new nodes to my
TreeView (it pretty much adds the entire tree). I saw someone had a
similar problem in another newsgroup, however he had no explanation.
Any help would be great.

Dianna
'Initial Call
Iterate_Aux(treeEvents.Nodes(0), rdr("parent_id"))
'Recursive Search
Public Sub Iterate_Aux(ByRef theNode As TreeNode, ByVal id As String)
For Each theChildNode As TreeNode In theNode.Nodes
If theChildNode.Tag = id Then
treeEvents.SelectedNode = theChildNode
Exit Sub
End If
Iterate_Aux(theChildNode, id)
Next
End Sub

Feb 5 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.