473,466 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Treeview (Basic question)

hello all,
New programmer to the .net world.

I am working with VS.net 2005 using VB.

So here goes.
I am trying to figure out how the treeview control works from a programming
perspective. I know how to populate it manually with the control properties.
my question revolves around the use of the Node method creating Root-parent
and the children of the parent.
for example
Country (Root)
US (parent)
States (Child)
Ohio (Sub child)
cities
Akron
cleveland
NY
Cities
Hamburg

in sudo code.
Sub
Create the tree object.
go to the root node and populate it.
if root is expanded create the parents
if a parent is expanded create the appropriate children
Endsub

Most of my questions revolve around understanding how to traverse the nodes.

thanks for anyones or everyones help
JayC
New to the .net world.

Sep 14 '06 #1
2 1373
Hi Jay,

It's real straight-forward; each TreeNode object has a Nodes collection
class member (of type TreeNodeCollection) that contains the TreeNode objects
that represent its children. That is, there is no single collection of all
the nodes in the tree; each node is essentially a container for its
children.

The Tree itself has a Nodes member that is a collection of all the top level
nodes; each of these has its children, etc.

If you want a single root node in the tree, then just add 1 TreeNode to the
Tree.Nodes collection, and then add children to that single root node.

HTH ...

"JayC" <Ja**@discussions.microsoft.comwrote in message
news:41**********************************@microsof t.com...
hello all,
New programmer to the .net world.

I am working with VS.net 2005 using VB.

So here goes.
I am trying to figure out how the treeview control works from a
programming
perspective. I know how to populate it manually with the control
properties.
my question revolves around the use of the Node method creating
Root-parent
and the children of the parent.
for example
Country (Root)
US (parent)
States (Child)
Ohio (Sub child)
cities
Akron
cleveland
NY
Cities
Hamburg

in sudo code.
Sub
Create the tree object.
go to the root node and populate it.
if root is expanded create the parents
if a parent is expanded create the appropriate children
Endsub

Most of my questions revolve around understanding how to traverse the
nodes.

thanks for anyones or everyones help
JayC
New to the .net world.

Sep 15 '06 #2
that is what the document says. how about a simple example of doing a root
node, a child node and then a child of a child.

I am dense.

"Emby" wrote:
Hi Jay,

It's real straight-forward; each TreeNode object has a Nodes collection
class member (of type TreeNodeCollection) that contains the TreeNode objects
that represent its children. That is, there is no single collection of all
the nodes in the tree; each node is essentially a container for its
children.

The Tree itself has a Nodes member that is a collection of all the top level
nodes; each of these has its children, etc.

If you want a single root node in the tree, then just add 1 TreeNode to the
Tree.Nodes collection, and then add children to that single root node.

HTH ...

"JayC" <Ja**@discussions.microsoft.comwrote in message
news:41**********************************@microsof t.com...
hello all,
New programmer to the .net world.

I am working with VS.net 2005 using VB.

So here goes.
I am trying to figure out how the treeview control works from a
programming
perspective. I know how to populate it manually with the control
properties.
my question revolves around the use of the Node method creating
Root-parent
and the children of the parent.
for example
Country (Root)
US (parent)
States (Child)
Ohio (Sub child)
cities
Akron
cleveland
NY
Cities
Hamburg

in sudo code.
Sub
Create the tree object.
go to the root node and populate it.
if root is expanded create the parents
if a parent is expanded create the appropriate children
Endsub

Most of my questions revolve around understanding how to traverse the
nodes.

thanks for anyones or everyones help
JayC
New to the .net world.


Oct 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Access User | last post by:
I'm looking for complete documentation for the activex component "TreeView" in Access. I need a complete list of methods and properties, if such a thing exists. Paul
3
by: sho_nuff | last post by:
Question here: I have been trying to find a way to add existing nested nodes to a tree that already has nodes in it: So, my tree looks like this: -com -foo -goo
4
by: Ian Powell | last post by:
Hi I've got objects in an sorted ArrayList like: P:\ P:\\DOCS P:\\i386 P:\\i386\ASMS P:\\i386\ASMS\1000 P:\\i386\ASMS\1000\MSFT
1
by: http://www.visual-basic-data-mining.net/forum | last post by:
Hello, I am working on Treeview control. I want that, user create tree according to his requirement, can add topic under any node. Then just click update and that treeview data to be stored in...
0
by: Teemu | last post by:
Hello. Please bear with me if this seems like a basic question (I'm just getting started with all this ASP.NET and WebControls stuff). Anyway, I'm trying to programmatically build a...
3
by: Gerhard | last post by:
I have the following code in an .net 2.0 project: <asp:Panel Runat="server" id="pnlNavigation" CssClass="pnlNavigation" Width="165px"> <asp:TreeView ID="TreeView1" runat="server"...
6
by: Beginner | last post by:
Hi, I'm trying to populate a TreeView from an existing and filled in ListView (lvwBuild). lvwBuild is a basic two column listview which can have any number of rows. I would like the first...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
0
by: Ahmed Yasser Dev | last post by:
Hi all, i am new to web development. My question is, is there is a TreeView control in the web applications ( Visual basic.net 2003). If not, what to do to build up a treeview component like the one...
2
by: crystalelle | last post by:
Hi, I am in desperate of help. I am working with visual basic .net 2005. My interface is made from treeview control and tab control. The big question here is how do I load the tab control...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.