views:

13068

answers:

13

If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere?

These are some of the known grid display solutions I have found for ASP.NET MVC

If you know of anything else that you are using or know to be good, please let me know.

+3  A: 

If it's just for viewing data, I use simple foreach or even aspRepeater. For editing I build specialized views and actions. Didn't like webforms GridView inline edit capabilities anyway, this is kinda much clearer and better - one view for viewing and another for edit/new.

Hrvoje
+14  A: 

We have just rolled our own due to limited functionality requirements on our grids. We use some JQuery here and there for some niceties like pagination and that is all we really need.

If you need something a little more fully featured you could check out ExtJs grids here.

Also MvcContrib has a grid implementation that you could check out - try here. Or more specifically here.

berko
Also used extjs before. Really liked it using it.
Dai Bok
+4  A: 

We have been using jqGrid on a project and have had some good luck with it. Lots of options for inline editing, etc. If that stuff isn't necessary, then we've just used a plain foreach loop like @Hrvoje.

Sean Carpenter
+5  A: 

I just discovered Telerik has some great components, including Grid, and they are open source too. http://demos.telerik.com/aspnet-mvc/

Dejan Milicic
I spent the last day working with the Telerik grid, and it's pretty nice, if you can manage to stay on the ever-elusive "happy path." However, my app uses restful routing (i.e., where my deletes would post to "/controller/{id}" with an Http Method override of DELETE), and that was apparently too far off the "happy path" for the Telerik grid to be useful to me, and their code is too tightly coupled to cleanly override its behavior through inheritance, etc.
jrnail23
+3  A: 

We use the MVCContrib Grid.

http://weblogs.asp.net/rajbk/archive/2010/05/08/asp-net-mvc-paging-sorting-filtering-using-the-mvccontrib-grid-and-pager.aspx

Raj Kaimal
I had seen you tutorial code in one of the rss feeds. It was helpful to me on a project I just started.
MikeJ
A: 

Is there any reason why there is no grid in the ASP.NET MVC framework? One would think that this is very often used control in any normal line of business or point of sale application.

All the forementioned grids are very nice grids but they were not built having ASP.NET MVC in mind.

Gabriel Lozano-Moran
Not sure how any of those grids were built without ASP.NET MVC in mind . . .
Wyatt Barnett
ASP.NET MVC 3 has a grid.
Craig
look my grid here:http://mvccontrolstoolkit.codeplex.com/wikipage?title=DataGrid%20and%20Pager%20Complete%20Example and pls explain me why it doesn't conform with MVC
Francesco Abbruzzese
+1  A: 

If it is read-only a good idea would be to create a table, then apply some really easy-but-powerful JQuery to that.

For simple alternative colour, try this simple JQuery.

If you need sorting, this JQuery plug-in simply rocks.

Mark Kadlec
yes. I saw this. Scott Hanselman was talking about this when Phil Hack posted his repeater helper code in this article : http://haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc.aspx
MikeJ
I think that's how I found out about the first link as well! Most of the grid stuff I do now is mostly done on the client. Scott's tip was well taken.
Mark Kadlec
+1  A: 

Try: http://mvcjqgridcontrol.codeplex.com/ It's basically a MVC-compliant jQuery Grid wrapper with full .Net support

sternr
+1  A: 

jqGrid is $299 if you use a special version that has server side integration, but it really is not that difficult to use the open source free version with ASP.NET MVC, once you get your jquery configuration straight it's almost as simple to use as any other licensed grid:

http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx

Manuel Castro
+1  A: 

We use Slick Grid in Stack Exchange Data Explorer (example containing 2000 rows).

I found it outperforms jqGrid and flexigrid. It has a very complete feature set and I could not recommend it enough.

Samples of its usage are here.

You can see source samples on how it is integrated to an ASP.NET MVC app here: http://code.google.com/p/stack-exchange-data-explorer/

Sam Saffron
+1  A: 

I'm in the state of decision making too, and was going to use Telerik's MVC controls, but it reqiers commersial lisence, so what is the best "total free use" controls for displaying grid ?

Nazar Gargol
I believe the Telerik MVC Controls are completely free. Try them out.
drpcken
They ship under GPLv2 license, and my project might have some commercial use.
Nazar Gargol
i like the jQuery grid since I use so many other parts of jQuery in my apps, but your choice might be different. really it comes down to developing a development pattern around a tool you like and then applying it where needed in your application(s).
MikeJ
+4  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. The DataGrid 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
+2  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