Accepted answer


you need to use the groupby function.


please see this link. it uses an extension method .ashierarchy() to represent hierarchical data

the returned object would be in tree structure. you just then have to decided on your presentation logic(space for each child node)


you can build a simple set of html in your action code assign specific values of your html that you build dynamically in your action with values you get by using linq. then on you view when you return it using viewdata render it as pure html and use jquery to create the tree here some good example of jquery tree plugin

Related Query

More Query from same tag