I have this structure of List
, to be specific it is a \"CategoryItem\" Object. Here\'s my declaration of \"CategoryItem\" Object.
Maybe take a look at the TreeView control? http://msdn.microsoft.com/en-us/library/7a9swst5(v=vs.80).aspx
The ASP.NET TreeView control is designed to present users with data in a hierarchical structure. Users can open individual nodes that can in turn contain child nodes. The TreeView control is suitable for displaying XML data, but can be used for any data that can be represented in a hierarchy.
I think it will be what you want.
Otherwise, it's a matter of iterating through each item in your list and recursively processing each sub-item which may or may not have more sub-items. It's tricky, but only at first.