Welcome Guest Search | Active Topics | Sign In | Register

Bind TreeView to SqlDataSource Options
Jerm
Posted: Friday, February 22, 2008 8:41:12 AM
Rank: Newbie
Groups: Member

Joined: 2/22/2008
Posts: 1
Is there some sample code that you guys have that shows how to bind your TreeView control to an SQLDataSource?
eo_support
Posted: Friday, February 22, 2008 8:46:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi,

You won't be able to do that directly because SqlDataSource gives you tabular data and the TreeView requires hierarchical data. What you will need to do is to fill a DataSet or DataTable from the SqlDataSource (or any other mean), then populate the TreeView from the DataSet or DataTable. You can find detailed information here:

http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fDataBinding%2fpopulate_table.html
http://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fDataBinding%2fpopulate_dataset.html

There are also sample code that demonstrates these methods in our sample project. So you may want to load the sample project with Visual Studio and then play with it to see how it works.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.