Q: Bind SQL table to TreeView

M

Martin Arvidsson

Hi!

I have a table containing three columns, containing following data..

ID, SUB, DESCRIPTION
1,0,Main
2,0,Main2
3,2,Main2 Subto2

What i want to do is to fill the tree view with the data

if sub is non zero, i want to create a subtree of ID...
Is it possible or do i have to fill a DataSet, read all data and manually
set the data to the treeview?

Regards
Martin
 
G

Grant Frisken

You will have to create a typed DataSet and add a relation between the
ID field and SUB field. If you are using the standard TreeView you
will then have to use the relation to navigate the data and add nodes
to the TreeView programatically.

If you are willing to consider a commercial solution Infralution's
Virtual Tree can make this last part much easier. It provides a
flexible data binding mechanism that allows you to bind directly to the
data in the dataset - so you don't have to do this manually.

You can find more information and a fully functional evaluation version
at:
www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution
 

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