How to: Display multiple related classes in an ASP.NET GridView ?

Posted by kversch on Stack Overflow See other posts from Stack Overflow or by kversch
Published on 2010-06-04T11:17:29Z Indexed on 2010/06/09 9:22 UTC
Read the original article Hit count: 188

Filed under:
|
|

I would like to display students and their grades with a GridView and LinqToSQL like this:

                       assignment1                     assignment2                
Student 1              55                              89
Student 2              87                              56
Student 3              92                              34

I found this topic but it doesn't answer my question: http://forums.asp.net/t/1557987.aspx

I have a many-to-many relationship between students and assignments called "grades". The grade for the assignment is stored in that table in a "gradeNumber" column.

I would also like to specify which assignments should be displayed in the grid. Btw, my LINQ entities are extended to allow me to write/get studentx.Assignments or assignmentx.Students.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about linq-to-sql