I am working on a MVC5 ASP.net project using C#. I need to create a data grid in a view, from a list of entities where the column and row headers of the grid are dynamic.
Example:
List of entities
name school age
------------------
name1 sch1 10
name2 sch2 15
name3 sch3 9
name4 sch2 10
name5 sch1 15
name6 sch1 14
...
Required view:
sch1 sc2 sch3
--------------------------
9 name3
10 name1 name4
14 name6
15 name5 name2
The school names and ages cannot be predefined in this scenario.
Any suggestion is welcome.