concept MvcContrib Grid in category asp.net
appears as: MvcContrib Grid, The MvcContrib Grid

This is an excerpt from Manning's book ASP.NET MVC 2 in Action.
The MvcContrib Grid is a UI component that creates a well-formed HTML table. It uses a fluent interface, which allows you to define the configuration of the Grid with a strongly typed and refactoring-friendly syntax. The refactoring support makes this style of component work nicely with refactoring tools like JetBrains ReSharper and DevExpress Refactor! Pro. This type of component generally requires a strongly typed view, which is used to drive the API of the Grid.
Listing 5.2. Using the MvcContrib Grid with more control
<%= Html.Grid(Model).Columns(column => { column.For(x => x.Id).Named("Person ID"); column.For(x => x.Name); column.For(x => x.Gender); column.For(x => x.DateOfBirth).Format("{0:d}"); column.For(x => Html.ActionLink("View Person", "Show", new { id = x.Id})).DoNotEncode(); }) %>
The MvcContrib Grid created using the view code in listing 5.2 will render nicely in a table, as shown in figure 5.2.
The next step is to use the MvcContrib Grid to get a table-formatted view of our Person objects: