@model IQueryable<Person>
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.Name).Titled("Name").UsingDefaultFilterMethod("equals");
columns.Add(model => model.Surname).Titled("Surname").Filterable(GridFilterCase.Lower);
columns.Add(model => model.MaritalStatus).Titled("Marital status").Filterable(GridFilterType.Multi);
columns.Add(model => model.Age).Titled("Age").Filterable(false);
columns.Add(model => model.Birthday).Titled("Birthday").Filterable(GridFilterType.Double);
columns.Add(model => model.IsWorking).Titled("Employed").UsingFilterOptions(new[]
{
new SelectListItem(),
new SelectListItem { Value = "true", Text = "Working" },
new SelectListItem { Value = "false", Text = "Unemployed" }
});
})
.Empty("No data found")
.Filterable() // Enables single filtering for not explicitly configured property expression columns.
)