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




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com