Overview
Filters
Simple Blazor Grid comes with several filters than can be applied to columns to allow end users to refine their data. The table below lists all available filters are well as the types they can be applied to, click the filter name to see more details.
Filter | Types | Description |
---|---|---|
Date Filter | DateTime , DateOnly |
Filter by date / time and date |
Date Range Filter | DateTime , DateOnly as well their nullable counterparts |
Filter by date / time and date between a two input date |
Enum Filter | Enum , string |
Filter a property by either a single or multiple enum value(s) |
Numeric Filter | int , uint , long , ulong , short , ushort , float , double , decimal as well as their nullable counterparts |
Filter a numeric property by matching value |
Numeric Range Filter | int , uint , long , ulong , short , ushort , float , double , decimal as well as their nullable counterparts |
Filter a numeric property where it falls between two values |
String Filter | string |
Filter by a property by a string, includes case-sensitive and partial matching |
Filter Properties
All filters have a few properties that are shared regardless of their type, the table below lists these properties
Property | Type | Required | Description | Default Value |
---|---|---|---|---|
TType |
Type |
✅ | Type parameter, must match the type parameter specified by the surrounding grid. | null |
For |
Expression<Func<bool,T>> |
✅ | The property that this filter is for, example: For="@(x => x.MyProperty)" . |
null |
ForHeading |
string |
❌ | In the event that your grid has two columns that are for the same property, this can be used to determine which column has the filter applied to it, this should match the Heading property on the column you want the filter to apply to |
null |
Using Filters
All filters must be wrapper by the Filters
render fragment provided by the Simple Blazor Grid. The table below gives an example of how to use filters.