Ahmad Farid
Ahmad Farid

Reputation: 14774

How to display XML into a tree view?

I have a variable of XDocument, and I want to display its structure in a TreeView. I tried

TreeView1.DataSource = doc;

but I got this error

HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.

Upvotes: 0

Views: 508

Answers (1)

BlueCode
BlueCode

Reputation: 741

Use XmlDataSource as data source.

Upvotes: 1

Related Questions