By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,192 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,192 IT Pros & Developers. It's quick & easy.

Need Help in Populating A Treeview - Thanks

P: n/a
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


Sep 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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


Sep 23 '06 #2

P: n/a
That worked...Thanks

Steve
"Dennis" <De****@discussions.microsoft.comwrote in message
news:58**********************************@microsof t.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


Sep 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.