How to create a hirerical treeview control in VB.NET 2005.Like I want in this way.
:: GrandParent is GD1
Parent is : P1
and Child is C1,C2,C3 and so on.
Thanks.
:: GrandParent is GD1
Parent is : P1
and Child is C1,C2,C3 and so on.
Thanks.
'''Variable declaration
Dim gd1 as new Treenode
Dim p1 as new Treenode
Dim c1 as new Treenode
Dim c2 as new Treenode
Dim c3 as new Treenode
'''Define node for grandParent
gd1.Text = "GrandParent"
'''define node for parent
p1.Text = "Parent"
'''define child nodes
c1.Text = "Child1"
c2.Text = "Child2"
c3.Text = "Child3"
'''Add child nodes to parent node
p1.Nodes.Add(c1)
p1.Nodes.Add(c2)
p1.Nodes.Add(c3)
''Add parent node to grandparent node
gd1.Nodes.Add(p1)
''Now, you can add grandparent node to treeview control
Treeview1.Nodes.Add("gd1")
Comment