开发者

Is it possible to add child nodes to the added custom nodes

开发者 https://www.devze.com 2023-01-14 15:01 出处:网络
the actual procees of my work is initially i will have a root node for a treeview. If i right click on that i will have a context menu with some options. If i select add new from that i will add a tex

the actual procees of my work is initially i will have a root node for a treeview. If i right click on that i will have a context menu with some options. If i select add new from that i will add a text file as child node to the root node. This works fine . After adding that text file i would like to add a child node under that text file..

The over all flow will be

Initially when page loads my treeview will be with a single rootnode

ACH

If i add a text file i would like to show my treeview as follows

ACH

 |-> some.txt

|->A( Child for some.txt)

   |->B(child for  A) 

       |->C(C开发者_StackOverflow社区hild for B)

Up to A i was succeded but i do not know how to add the remaining also i would like to set image index for the custom child nodes added


You have to keep a reference to the node A and call Add on its Nodes property:

TreeNode nodeA = nodeACH.Nodes.Add("A");

TreeNode nodeB = node1.Nodes.Add("A");

TreeNode nodeC = node1.Nodes.Add("B");
0

精彩评论

暂无评论...
验证码 换一张
取 消