Filling TreeView with Recursive Function ?

L

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
 
S

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
 
L

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top