0

I am a newbie to MVC3...

I am trying to display a grid (3 columns) that contains list of students (in column1) with checkboxes in columns 2 & 3. The header of those columns are in order: student Name, Seminar1 & Seminar 2. The checboxes will represent if the student attended each seminar.

The two pieces of info (student & seminar) are coming from unconnected tables in the db. So, I am thinking of this approach:

  1. Create a datatable in the controller.
  2. Make it a property in a model class
  3. Display it in the webgrid in the view

At the end I want to be able to display the checkboxes with the proper values, trap their CHECKED events and preferably make it all ajaxable

Am I violating any rules if I do that view-related effort in the controller? If I shouldn't how would I do it in the Webgrid? How would you approach it?

Thanks

Venki
  • 1,419
  • 5
  • 28
  • 38
user1019042
  • 2,428
  • 9
  • 43
  • 85

1 Answers1

0

I usually use JQGrid for this kind of tables. You can see an example here: ASP.Net MVC 3 JQGrid

You can have Student object as a model, and use linq and Entity Framework to return a list of students.

JQGrid supports Ajax as well. here are more demos: http://www.trirand.com/blog/jqgrid/jqgrid.html

Community
  • 1
  • 1
Reza
  • 834
  • 1
  • 7
  • 18