Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / November 2006

Tip: Looking for answers? Try searching our database.

GrandChild to a node in a Treeview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sean - 08 Nov 2006 15:08 GMT
How do I add a grandchild to a node programatically  in a Treeview?
VJ - 09 Nov 2006 02:38 GMT
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

> How do I add a grandchild to a node programatically  in a Treeview?
VJ - 09 Nov 2006 02:40 GMT
sorry it has to node1.Nodes[0].Nodes[0].Add.. but I guess you get the idea..

Vijay

> How do I add a grandchild to a node programatically  in a Treeview?
Sean - 09 Nov 2006 14:27 GMT
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.

> sorry it has to node1.Nodes[0].Nodes[0].Add.. but I guess you get the idea..
>
> Vijay
>
> > How do I add a grandchild to a node programatically  in a Treeview?
Robbe Morris [C# MVP] - 14 Nov 2006 02:59 GMT
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


Signature

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

> VJ,
> Thanks for your response but that is not what I was looking for. I need it
[quoted text clipped - 7 lines]
>>
>> > How do I add a grandchild to a node programatically  in a Treeview?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.