Binding Hierarchical DataSets to TreeView Controls

OOB the ASP.NET TreeView control doesn’t support binding to Hierarchical DataSets. Ralph Varjabedian created a HierarchicalDataSet class to help with this. Read more about it here.

Here’s a snippet…it’s simple to implement:

TreeView1.DataSource = new HierarchicalDataSet(dataSet, "ID", "ParentID");

Share