@model IQueryable<Person>
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.Name).Titled("Name").Sortable(true);
columns.Add(model => model.Surname).Titled("Surname").Sortable(false);
columns.Add(model => model.MaritalStatus).Titled("Marital status"); // Enums are sorted by their value and not by their string representation.
columns.Add(model => model.Age).Titled("Age").Sortable(GridSortOrder.Desc); // Sets first sort order to desc instead of asc.
columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
columns.Add(model => model.IsWorking).Titled("Employed");
})
.Sortable() // Enables sorting for not explicitly configured property expression columns.
)