hello experts,
I have a window forms application where there are already treeview designed.
But I want to add a Node and child to that nodes based on condition.
That Node should be on the TOP of all the existing nodes designed in designer.
This is what I have tried but the nodes are being added to the frst node already in designer .
For example My existing Nodes are like
Node1
Node1 child 1
Node 1 Child 2
Node2
Node 2 Child 1
continues
Now My code does below
Node1
Node1 child1
Node1 child2
Top Node
A
B
C
Node 2
Node 2 child1
However I am looking for something like below
Top Node
A
B
C
Node 1
Node 1 Child 1
Node 1 Child 2
Node 2
Node 2 child 1
continues
Could someone please help me
What I have tried:
If TreeView1.Nodes.Count > 0 Then
TreeView1.Nodes(0).Nodes.Insert(0, "TopNode")
TreeView1.Nodes(0).Nodes.Add("A")
TreeView1.Nodes(0).Nodes.Add("B")
TreeView1.Nodes(0).Nodes.Add("C")
End if