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?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
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.htmlhttp://www.essentialobjects.com/ViewDoc.aspx?t=MenuCommon%2fDataBinding%2fpopulate_dataset.htmlThere 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
|