Add child node to treeview node
-
Hello Experts!! I am creating treeview at runtime also added node to treeview successfully but i dont know how to add child node to respective same node. Help!!
http://lmgtfy.com/?q=c%23+add+child+to+treenode[^] The first result is the MSDN page, which has an example
Help me! I'm turning into a grapefruit! Buzzwords!
-
Hello Experts!! I am creating treeview at runtime also added node to treeview successfully but i dont know how to add child node to respective same node. Help!!
I would assume you added the first node with...
TreeView1.Nodes.Add("a node");
Well, each node also has a collection of nodes so if you store the return value of the above method, or obtain the node with another method search as find then you can add nodes to the collection like...
TreeNode baseNode = TreeView1.Nodes.Add("Something");
baseNode.Nodes.Add("My First Child Node");Hope that helps :)
Life goes very fast. Tomorrow, today is already yesterday.