Question convert string to vb.net code

nagyanwar

New member
Joined
Sep 7, 2010
Messages
3
Programming Experience
Beginner
Hi...
I have code like this :
Dim node = "n3"
Dim x1 = "tree_category.Nodes("""
Dim x2 = """).Nodes("""
Dim x3 = """).Nodes.Add(""" & node & """)"
Dim x4 = x1 & "n1" & x2 & "n2" & x3

so x4 is : "tree_category.Nodes("n1").Nodes("n2").Nodes.Add("n3")"

how can i covert this string to code to create the node?
 
dynamic tree

it's all happened when i was building a dynamic tree with 2 or 3 or 4 ...... levels
and this idea came to my head and i sew it a challenge
so i need it if it possible and tree dynamic creation
 
Writing code that does that dynamically is not difficult, where parent is a string and children is a string array or list:
        Dim node = tree_category.Nodes.Add(parent)
        For Each child In children
            node = node.Nodes.Add(child)
        Next
 
Back
Top