Re: Treeview (Basic question)



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" <JayC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:41609399-BD5D-4301-A918-79E3A42B14B1@xxxxxxxxxxxxxxxx
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.




.



Relevant Pages

  • Re: Walk DOM Tree in Reverse?
    ... I think of .lastChild as a rightmost child ... algorithm will traverse all nodes (sadly not necessarily visiting each ... node is the root of a tree containing all the nodes. ...
    (comp.lang.javascript)
  • Re: SQL, related records (quotes)
    ... CONSTRAINT CHECK, ... child parent ... Multiple trees are easily mapped to branches of one root ... Starting with an empty relation with just a key constraint on 'child', ...
    (comp.databases.theory)
  • Re: strange mouse behaviour on dialog called frm a tree
    ... > functions to add/ delete/ rename nodes of the tree. ... > Everything worked fine when I call this dialog on rightclicking the ... > root or its child.Problem comes up on rightclick of a node on the third ... > input the name on right click of the child of the child of the root, ...
    (microsoft.public.vc.mfc)
  • Re: strange mouse behaviour on dialog called frm a tree
    ... > functions to add/ delete/ rename nodes of the tree. ... > Everything worked fine when I call this dialog on rightclicking the ... > root or its child.Problem comes up on rightclick of a node on the third ... > input the name on right click of the child of the child of the root, ...
    (microsoft.public.vc.mfc)
  • Re: SQL, related records (quotes)
    ... Let's say for the hierarchy itself we decide on ... child parent ... child B to reference for referential integrity and what meaning the ... possible with a vertex involving itself as a root node of a hierarchy. ...
    (comp.databases.theory)