Name | Surname | Marital status | Age | Birthday | Employed |
---|---|---|---|---|---|
Henry | Crux | Single | 34 | 11/19/1990 | True |
Cody | Jurut | 54 | 8/11/1970 | False |
[HttpGet]
public ViewResult Index()
{
return View(Context.Set<Person>());
}
@model IQueryable<Person>
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.Name).Titled("Name");
columns.Add(model => model.Surname).Titled("Surname");
columns.Add(model => model.MaritalStatus).Titled("Marital status");
columns.Add(model => model.Age).Titled("Age");
columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
columns.Add(model => model.IsWorking).Titled("Employed");
})
.Pageable(pager =>
{
pager.CurrentPage = 2;
pager.RowsPerPage = 2;
})
)