views:

8886

answers:

7

Is it possible to use a datagrid control in a mvc "view"?

How would I bind it to a datasource?

+4  A: 

check this tip by Stephen Walther for implementation ideas
another option would be to buy a third party control, such as this

Asaf David
+3  A: 

just started playing with the grid from http://www.codeplex.com/MVCContrib

initially it looks like a good solution

cavemandeveloper
+2  A: 

Check the blog post ASP.NET MVC Grid View using MVCContrib

Shiju
+6  A: 

Check this out, using jQuery grid with ASP.NET MVC: http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx

Danny
+1  A: 

You can use also the Insert/update/delete datagrid of my MVC Controls Toolkit available here on codeplex: http://mvccontrolstoolkit.codeplex.com/. Here you can download a complete example, here the datagrid working and here a tutorial. It works completely client side and mantains thechange set between postback. Yes it mantains Changeset, this means, you can access both old version and modified version of each record to see what changes to pass to the DB(what need to be modified deleeted or inserted). This Changeset is mantained after several postback till you either confirm or cance the modifications on the server side

Francesco Abbruzzese
+3  A: 

I downloaded a complete project with a datagrid that handles deletion editing and insetion and paging here. It is very easy to use and to save the changes on the db

marco
+1  A: 

I tried the example here of the Mvc Controls Toolkit grid. It appears a quite powerful and easy to use grid. The tutorial not only explain how to use the grid but also how to do paging, organize a view model and data annotations. It is worth to read it.

MvcSurfer