.NETGURU
Treenode add
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngwebcontrols' list.


=?iso-8859-1?Q?Jonathan_Hjertstr=F6m?=
Hi,

I wonder if anyone can help me with how to add nodes programmatically?
I have got this code:

Dim tvTreeNode As TreeNode =3D New TreeNode()
tvTreeNode.Text =3D "Top number 1"
TreeView1.Nodes.Add(tvTreeNode)

This will perfectly fine write out one node. But how do I add child =
nodes to this one?=20

Many thanks for any help.

/
**************************************************************
Jonathan Hjertstr=F6m,
Software Developer, K2-Informatics (U) Ltd.
32, Kanjokya Street, Kololo, P.O. Box 8628,
Kampala, Uganda
tel. +256 41 532 865 / 871 / 873
fax. +256 41 532 910
http://www.k2informatics.com
**************************************************************

Reply to this message...
 
    
Michael S. Hunsicker
Hi Jonathan,=20

You can add child nodes in the same way that you added a node to the
treeview.

e.g=20
=09
    Dim tvTreeNode As TreeNode =3D New TreeNode()
tvTreeNode.Text =3D "Top number 1"
=09
    Dim tvChildNode As TreeNode =3D New TreeNode()
    tvChildNode.Text =3D "Child number 1"

    tvTreeNode.Nodes.Add(tvChildNode)    =09
TreeView1.Nodes.Add(tvTreeNode)

Here are a couple of very helpful articles:

general overview -
http://msdn.microsoft.com/library/default.asp?url=3D/workshop/webcontrol=
s/over
view/treeview.asp

adding nodes dynamically -
http://support.microsoft.com/default.aspx?scid=3Dkb;en-us;Q319441

Hope this helps,=20
Mike Hunsicker

-----Original Message-----
From: Jonathan Hjertstr=F6m [mailto:Click here to reveal e-mail address]
Sent: Monday, June 24, 2002 5:10 AM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Treenode add

Hi,

I wonder if anyone can help me with how to add nodes programmatically?
I have got this code:

Dim tvTreeNode As TreeNode =3D New TreeNode()
tvTreeNode.Text =3D "Top number 1"
TreeView1.Nodes.Add(tvTreeNode)

This will perfectly fine write out one node. But how do I add child =
nodes to
this one?=20

Many thanks for any help.

/
**************************************************************
Jonathan Hjertstr=F6m,
Software Developer, K2-Informatics (U) Ltd.
32, Kanjokya Street, Kololo, P.O. Box 8628,
Kampala, Uganda
tel. +256 41 532 865 / 871 / 873
fax. +256 41 532 910
http://www.k2informatics.com
**************************************************************

| [aspngwebcontrols] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp =3D JOIN/QUIT

This e-mail and any attachments may contain privileged and/or =
confidential
information.
This e-mail is intended solely for the use of the individual or entity =
to
which it is
addressed. If you are not the intended recipient of this e-mail, you =
are
hereby notified
that any copying, distribution, dissemination or action taken in =
relation to
the contents
of this e-mail and any of its attachments is strictly prohibited and =
may be
unlawful.
If you have received this e-mail in error, please notify the sender
immediately and
permanently delete the original e-mail and destroy any copies or =
printouts
of this
e-mail as well as any attachments.

Reply to this message...
 
 
System.Windows.Forms.TreeNode




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification