Creating a Hierarchical DataSource from a DataSet
I've already covered creating custom tabular DataSources in previous posts, but sometimes they just aren't enough. For example, the ASP.NET 2.0 Menu and TreeView controls are designed to bind to a new type of HierarchicalDataSource. Bertrand Le Roy has a fantastic blog post on this. As creative as his example was, I wanted to tweak it a little bit to fit my needs. For example, Mr. Le Roy uses multiple tabular DataSources, and binds them together with his Relation parameters. This seemed a little round-about to me. Why take a DataSet, break it up into tabular DataSources, then combine them again back into a DataSet, when you could just serve up the DataSet whole, and provide much less information to the Controls? Also, the above example did not have a SelectMethod, instead it simply showed the contents of an entire table.
The code to use this control is really straight forward, so rather than go into a detailed analysis, how about a screenshot?

You can download the sample project below. It is the same one from my post on the FriendlyDal, and it will probably continue to be expanded I blog about more fun stuff.
Cheers,
Brent
Attachment(s): OrgChart.zip