I’m working on replacing an existing web grid in an ASP.NET web application, with a new implementation. The existing grid is powerful, but not flexible enough. It also brings with it all kind of frameworks we don’t like to have on our web pages.
While looking into existing options I noticed I can break the available solutions into two main approaches. The older approach is represented best by the ASP.NET GridView. This is a classic ASP.NET control that generates the needed HTML on the server, based on a given set of data. The newer approach is depending on client side rendering, mainly with jQuery. A good example would be jqGrid. Only the data is sent to the client (Usually with JSON or XML)
In the GridView case, if I want an AJAX behavior, I would have to implement it with something like an update panel.
- Is there a definitive choice I should make?
- Is there a good chance of achieving the same snappy behavior I get with jqGrid (even with many records), with server side rendered controls?
- Is there some hybrid implementation incorporating both approaches?
There is no definitive choice you should make, but it’s worth noting
that changing to client-side AJAX controls is a pretty big paradigm
shift that will require you to rethink how you do nearly everything
with the grid.
Going half-way (by using a server-side control such as
GridViewin an
UpdatePanel) will likely improve the user experience, sincethe page will still be visible and responsive while it’s updating. But
the
UpdatePanel-style is still clunky compared to the new client-onlygrids, because this technique sends all the page’s form data when it posts back
(including all that ViewState in the
GridView, if ViewState is turnedon). One brief note of caution:
GridViewis not compatible withUpdatePanelwhenGridView.EnableSortingAndPagingCallbacksis set to true.I haven’t used any of they hybrid implementations (such as Coolite’s Ext wrappers for .NET), but they are out there. There was at least one good SO discussion about this topic and the different grids available here.