I have looked at a few data grids for an asp.net mvc app I am developing. I would like to get some opinions on the different datagrids for asp.net mvc. I would like to know the pros/cons with the data grid, if you care to share.
I prefer to use the Flexigrid JQuery datagrid: http://www.flexigrid.info/
There are a number of different options. If you are using jquery I've heard that the jqgrid is a nice grid plugin. Phil Haack did a nice blog post on it.
Another option for further customization is to write a loop through your data and create your own html table.
I've been using the flexigrid jquery plugin for a while now and it works well enough, but it's not being maintained anymore and i think it has a few issues in chrome. It generates a lot of markup which would make it harder style if you wanted something custom.
I'm planning to use the jquery datatables plugin from now on. The current beta supports server side paging, and it's pretty much just a table and a few other elements depending on your configuration. Much easier to style and a lot leaner than flexigrid.
The DataGrid control in MVC is fantastic.
It works like this:
<table>
<tr><th>Field 1</th><th>Field 2</th></tr>
<% foreach( var item in this.Model ) { %>
<tr>
<td><%= item.Property1 %></td>
<td><%= item.Property2 %></td>
</tr>
<% } %>
</table>
:-)
Seriously though - I've found this model to be far easier to work with than any ServerControl/DataBinding/UserControl/jQuery-plugin method.
Easier to extend and easier to maintain.
I agree with Keith if your only problem is just displayind data, but if you have also to edit/update/delet and insert new items....it is better to have REAL data grid. Here I found a Datagrid that works well and also Mantain both Old/New version of each item. This way it is very easy to pass changes to the DB. It has also a pager. Everything conforms to the spirit of MVC...see it.