views:

295

answers:

1

Is it possible to use a SQL query that returns XML, in order to bind a TreeView control to SQL data? In other words, I would like to set up a query that presents table data as hieracrhical XML, and bind this XML to the TreeView.

+1  A: 

Are you assuming to bind TreeView to XmlDataSource (XmlHierarchicalDataSourceView)?

You can implement your own IHierarchicalDataSource and HierarchicalDataSourceView for that. I thinks this solution would be better than returning XML from DB.

Tadas
Hmm, I was actually being lazy and trying to avoid my own implementation, but I will look at those, thanks.
ProfK