Populate IE Treeview control ( Recrusive )

  • Thread starter Thread starter Jonas Nilsson
  • Start date Start date
J

Jonas Nilsson

Hi!

I wan't to populate a IE Treeview control from one table in a database.

It looks like this:

Id
ParentId
Name
......

What is the best way to populate, i have tried to setup a relation between
the Id
and the ParentId field in the result DataSet but is doesn't seem to work.
( ds.Relations.Add( "SystemObject", ds.Tables[0].Columns["ParentId"],
ds.Tables[0].Columns["Id"] ) )
Returns this error:
( These columns don't currently have unique values )

Or should i use Rowfilter on a dataview to filter out the rows of a parent.

/Jonas
 
Hi Jonas,

Before you misunderstand, I mean in the dataadapter, not in the
table.select, that does not exist as distinct (however a lot wants that)

Cor
 
Hi,

I need a similar kind of help

I have a table which has 3 columns

id-->parent-->name
1-->0-->test
2-->0-->test1
3-->0-->test2
4-->1-->tester

now i want to display this data in a treeview control without any code of xml like the one in the article. I hope you can help me. Please its urgent.

i want the treeview to be displayed like this:

-test
|-tester(child node for test)
|test1
|test2

Thanks in advance.

Regards
 
Hi,

I got the above to work. But i now have a new problem. How do i retrieve the id of the node that i select.

Please help this is reallt urgent for me.

Thanks in advance

Regards
 
Back
Top