Prakash Kunwar
Prakash Kunwar

Reputation: 797

How to create multiple tree view in single treeview in winforms?

enter image description here

hi buddy! I want to create multiple treeviews in single treeview as it is shown in above figure. i can create only one treeview but cannot create another one with no links.

can anyone wake me up from this nightmare???

Upvotes: 1

Views: 3127

Answers (1)

Eranga
Eranga

Reputation: 32437

treeView1.BeginUpdate();
treeView1.ShowRootLines = false;
treeView1.ShowLines = false;
treeView1.Nodes.Add("Parent");
treeView1.Nodes[0].Nodes.Add("Child 1");
treeView1.Nodes[0].Nodes.Add("Child 2");
treeView1.Nodes[0].Nodes[1].Nodes.Add("Grandchild");
treeView1.Nodes[0].Nodes[1].Nodes[0].Nodes.Add("Great Grandchild");
treeView1.EndUpdate();

just copied and edited the example on MSDN

Upvotes: 1

Related Questions