0

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.

1 Answer 1

1

Is it possible to do data pivot first? For example, if your entities come from database, you can do pivot in database to generate a table format looks like your view. Otherwise, you might need some code to convert, either javascript or vb/c#.net

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for the answer @John Jin . What would you think complies with OO principles of EF and MVC5 best?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.