Home All Groups Group Topic Archive Search About

Filling TreeView with Recursive Function ?

Author
5 Nov 2006 9:41 PM
Luqman
I am using VB.Net 2005 and I want to fill the Tree View with Oracle
Scott/Tiger Table which contains Parent/Child keys in one table, how can I ?

In VB-6, I used TreeView Key while in VB.Net 2005, there is no Key in
TreeView, how can I fill the control ?

Best Regards,

Luqman

Author
6 Nov 2006 1:12 AM
Smokey Grindel
use a hash table to make a reference key to the node

like this

Dim MyNodes as new hashtable()
dim node as new treenode
Mytreeview.nodes.add(node)
mynodes.add(Key,node)

then to use the key
directcast(mynodes(key),treenode).nodes.add(nodea)

just a quick psuedo code example, its not necessarly syntatically correct


Show quoteHide quote
"Luqman" <pearls***@cyber.net.pk> wrote in message
news:OM2b7MSAHHA.4472@TK2MSFTNGP03.phx.gbl...
>I am using VB.Net 2005 and I want to fill the Tree View with Oracle
>Scott/Tiger Table which contains Parent/Child keys in one table, how can I
>?
>
> In VB-6, I used TreeView Key while in VB.Net 2005, there is no Key in
> TreeView, how can I fill the control ?
>
> Best Regards,
>
> Luqman
>
>
Author
7 Nov 2006 1:00 PM
Luqman
Hi,

Thanks for notifying about Hashtable.

It means, I have to put the data with key/value to hashtable before adding
to treeview nodes.

I tried using Datarow but as the data sorting is not as per sorting,
required by treeview, so I get errors about invalid keys.

Any idea / better solution to this will be appreciated, as I am new to
Hastable ?


Best Regards,

Luqman


Show quoteHide quote
"Smokey Grindel" <nospam@nospam.net> wrote in message
news:%23W4C0CUAHHA.144@TK2MSFTNGP02.phx.gbl...
> use a hash table to make a reference key to the node
>
> like this
>
> Dim MyNodes as new hashtable()
> dim node as new treenode
> Mytreeview.nodes.add(node)
> mynodes.add(Key,node)
>
> then to use the key
> directcast(mynodes(key),treenode).nodes.add(nodea)
>
> just a quick psuedo code example, its not necessarly syntatically correct
>
>
> "Luqman" <pearls***@cyber.net.pk> wrote in message
> news:OM2b7MSAHHA.4472@TK2MSFTNGP03.phx.gbl...
>>I am using VB.Net 2005 and I want to fill the Tree View with Oracle
>>Scott/Tiger Table which contains Parent/Child keys in one table, how can I
>>?
>>
>> In VB-6, I used TreeView Key while in VB.Net 2005, there is no Key in
>> TreeView, how can I fill the control ?
>>
>> Best Regards,
>>
>> Luqman
>>
>>
>
>