GrandChild to a node in a Treeview

  • Thread starter Thread starter Guest
  • Start date Start date
treeview.Nodes[0].Nodes[0].Add, assuming you want to add to the first
child/grandchild... Please check the syntax before you use my code.

VJ
 
VJ,
Thanks for your response but that is not what I was looking for. I need it
to be done programatically and it has to do with how to get to a specific
child and then add a grandchild to that child.

VJ said:
sorry it has to node1.Nodes[0].Nodes[0].Add.. but I guess you get the idea..

Vijay

Sean said:
How do I add a grandchild to a node programatically in a Treeview?
 
You use recursion to go either up or down the tree to
find the node you want.

I think this sample of mine has an example of finding
nodes in the tree recursively:

http://www.eggheadcafe.com/tutorials/aspnet/847ac120-3cdc-4249-8029-26c15de209d1/treeview-faq.aspx

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp





Sean said:
VJ,
Thanks for your response but that is not what I was looking for. I need it
to be done programatically and it has to do with how to get to a specific
child and then add a grandchild to that child.

VJ said:
sorry it has to node1.Nodes[0].Nodes[0].Add.. but I guess you get the
idea..

Vijay

Sean said:
How do I add a grandchild to a node programatically in a Treeview?
 
Back
Top