|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need Help in Populating A Treeview - ThanksTreeview1_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 I think it would be:
e.node.nodes.add(your child node) -- Show quoteHide quoteDennis 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 > > > > > 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 > > > > > > > > > > |
|||||||||||||||||||||||