Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

looping through a treeview to find Key

hi there, how can i ...

open a recordset ( got it )
loop through the recordset and add treeview nodes (got it)

** Check the main nodes FIRST, if the rs.field value is already listed then it goes under that node... i.e

Store1 has 2 location, store2 has 1 location...

adding nodes should show this..

Store1
|__Location1
| |__Address1
|__Location2
|__Address2
Store2
|__Location1
|__Address1

Thanks!!!
[490 byte] By [vchatlive] at [2007-11-11 10:14:11]
# 1 Re: looping through a treeview to find Key
basically i guess i need to loop through the treeview i think and find out if the Store1 location exists and if so then add it into the treeview under that. Thanks!
vchatlive at 2007-11-11 17:23:02 >
# 2 Re: looping through a treeview to find Key
so far i have it working but the main nodes get listted twice, how can i have an if/then statement or somethng that says if the node label already exists ( Store1 ) then put the location under it, otherwise make the node Store1 and put location under it... Thanks
vchatlive at 2007-11-11 17:24:02 >
# 3 Re: looping through a treeview to find Key
Duplicate nodes are showing up....

This is what i have

Store1
|__Address1
Store2
|__Address1
Store1
|__Address2

This is what i want

Store1
|__Address1
|__Address2
Store2
|__Address1

Thanks
vchatlive at 2007-11-11 17:25:00 >
# 4 Re: looping through a treeview to find Key
use store1 as a key (the string "store1") and similar to others, then when storing choose to store under var1 with key var1 , in this case var1 will contains the "storeX" for example and each time it will store under its proper correspondingg .
Amahdy at 2007-11-11 17:26:05 >