-
Notifications
You must be signed in to change notification settings - Fork 16
Filtering
Filtering
Since Grid.Mvc 2.0 you can enable filtering option for your columns. To enable this functionality use Filterable method:
Columns.Add(o => o.Customers.CompanyName)
.Titled("Company Name")
.Filterable(true)
.Width(220);After that you can filter this column. Grid.Mvc support several types of columns (specified in Add method):
- System.String
- System.Int32
- System.Int64
- System.Boolean
- System.DateTime
- System.Decimal
- System.Byte
- System.Double
- System.Single
Also supports nullable types of this list.
To build more user friendly interface Grid.Mvc has different filter widget for this types. TextFitlerWidget - provides filter interface for text columns (System.String). This means that if your column has text data - Grid.Mvc render specific filter interface:
NumberFilterWidget - provides filter interface for number columns (System.Int32, System.Decimal etc.) number.png BooleanFilterWidget - provides filter interface for boolean columns (System.Boolean): boolean.png DateTimeFilterWidget - provides filter interface for datetime columns (System.DateTime). To render DatePicker control you need setup Grid.Mvc datepicker (https://www.nuget.org/packages/Grid.Mvc.DatePicker/) on the page. datetime.png
Also you can create your own filter widget.