Trying to build a Treeview ChildNode Population Sub

sputnik75043

Member
Joined
Aug 28, 2010
Messages
13
Programming Experience
Beginner
I've got the root nodes populated
Now, I've got a bunch of sets of strings I would like to add to each of the child nodes, but I'm having a bit of a problem.

For instance - my root nodes are Pages, Posts, etc
For Posts, I have a string (PostsFunctions) that I'm splitting and using for child nodes. This code will work:
AddChildren(tv, tv.Nodes("Posts"), PostsFunctions)

However, I want it more dynamic, so I'm creating strings to match the node name
(PostsFUnctions, PagesFunctions, etc). I know I can create a specific line, based on the root nodes, to do exactly what I want (like above), but there are 17 root items and that seems to be a little 'not dynamic' for lack of a better phrase.

I want to iterate through the root nodes and add the strings based on that naming convention
I tried:
For i As Integer = 0 To 1
BuildFunctions(tv, tv.Nodes(i), tv.Nodes(i).Text + "Functions")
Next
but all that gave me was a child for each one with the parent name, like 'PostsFunctions' added to it - not the actual items in the PostFunctions string.

Any ideas on how to accomplish this?
 
Back
Top