Home All Groups Group Topic Archive Search About

Need Help in Populating A Treeview - Thanks

Author
23 Sep 2006 5:21 AM
Steve Arndt
I'm trying to populate a vb.net treeview using a SQLDataReader at
Treeview1_BeforeExpand.

Basically I have a Treeview with 5 parent nodes and 1 dummy child node per
parent. The first parent node is called Address is the parent I'm trying to
add new children under.

When BeforeExpand is triggered, it removes the dummy child under the Adress
parent node based on e.Node.FirstNode.Remove.  Then runs a private sub
called PopulateNode with e.Node as a passed variable (ByVal eNode As
TreeNode).

When PopulateNode is called, the records are pulled in from the database
using the reader.  This works fine.  But where I have problems is trying to
populate the new children under the parent node "Address".  I can't seem to
get the Treeview statement right to add/insert the children under the
"Address" parent.

Any help appreciated.

Thanks

Author
23 Sep 2006 1:40 PM
Dennis
I think it would be:

e.node.nodes.add(your child node)
--
Dennis in Houston


Show quoteHide quote
"Steve Arndt" wrote:

> I'm trying to populate a vb.net treeview using a SQLDataReader at
> Treeview1_BeforeExpand.
>
> Basically I have a Treeview with 5 parent nodes and 1 dummy child node per
> parent. The first parent node is called Address is the parent I'm trying to
> add new children under.
>
> When BeforeExpand is triggered, it removes the dummy child under the Adress
> parent node based on e.Node.FirstNode.Remove.  Then runs a private sub
> called PopulateNode with e.Node as a passed variable (ByVal eNode As
> TreeNode).
>
> When PopulateNode is called, the records are pulled in from the database
> using the reader.  This works fine.  But where I have problems is trying to
> populate the new children under the parent node "Address".  I can't seem to
> get the Treeview statement right to add/insert the children under the
> "Address" parent.
>
> Any help appreciated.
>
> Thanks
>
>
>
>
>
Author
23 Sep 2006 3:14 PM
Steve Arndt
That worked...Thanks

Steve
Show quoteHide quote
"Dennis" <Den***@discussions.microsoft.com> wrote in message
news:58DD3D08-26DB-465A-B171-481B07A19EC7@microsoft.com...
> I think it would be:
>
> e.node.nodes.add(your child node)
> --
> Dennis in Houston
>
>
> "Steve Arndt" wrote:
>
> > I'm trying to populate a vb.net treeview using a SQLDataReader at
> > Treeview1_BeforeExpand.
> >
> > Basically I have a Treeview with 5 parent nodes and 1 dummy child node
per
> > parent. The first parent node is called Address is the parent I'm trying
to
> > add new children under.
> >
> > When BeforeExpand is triggered, it removes the dummy child under the
Adress
> > parent node based on e.Node.FirstNode.Remove.  Then runs a private sub
> > called PopulateNode with e.Node as a passed variable (ByVal eNode As
> > TreeNode).
> >
> > When PopulateNode is called, the records are pulled in from the database
> > using the reader.  This works fine.  But where I have problems is trying
to
> > populate the new children under the parent node "Address".  I can't seem
to
> > get the Treeview statement right to add/insert the children under the
> > "Address" parent.
> >
> > Any help appreciated.
> >
> > Thanks
> >
> >
> >
> >
> >