Easiest way to convert IGrouping to IHierarchicalDataSource
I have a list of business objects that I want to display in a menu. I can quickly use LINQ to created nested groups to match the desired structure but have to manually iterate through each to instantiate and populate the menu items. I'm using the DevExpress ASPxMenu which supports IHierarchicalDataSource and IHierarchicalEnumerable. What's the easiest way for me to create convert my grouped list (as IGrouping) into one of these interfaces?
I had to do something similar for a hierarchical list from a database to display in a tree control. What I ended up doing was using LINQ2XML to create XElements as necessary to model the hierarchy, and then passing the top element to the tree control.