Class FilterRequest
Represents a filter definition requested by the grid.
Inherited Members
Namespace: Syncfusion.Blazor.Grids
Assembly: Syncfusion.Blazor.Grids.dll
Syntax
public class FilterRequest
Remarks
Instances of this class are provided through Filter and describe the filtering criteria that should be applied to the data source.
A filter can represent either a simple condition or a complex
condition composed of multiple predicates combined using logical
operators such as and and or.
Constructors
FilterRequest()
Declaration
public FilterRequest()
Properties
Condition
Gets or sets the logical condition used to combine predicates.
Declaration
[JsonPropertyName("condition")]
public string? Condition { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing a logical operator such as
|
Field
Gets or sets the field being filtered.
Declaration
[JsonPropertyName("field")]
public string? Field { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the field name, or null when not specified. |
IgnoreAccent
Gets or sets a value indicating whether accented and diacritic characters are ignored during filtering.
Declaration
[JsonPropertyName("ignoreAccent")]
public bool IgnoreAccent { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IgnoreCase
Gets or sets a value indicating whether filtering ignores character casing.
Declaration
[JsonPropertyName("ignoreCase")]
public bool IgnoreCase { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | true to perform case-insensitive filtering; otherwise, false. |
IsComplex
Gets or sets a value indicating whether this filter contains nested predicates.
Declaration
[JsonPropertyName("isComplex")]
public bool IsComplex { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | true if the filter represents a complex logical expression; otherwise, false. |
Operator
Gets or sets the filter operator.
Declaration
[JsonPropertyName("operator")]
public string? Operator { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the comparison operator, or null when not specified. |
Remarks
Common operators include equal, notequal,
contains, startswith, endswith,
greaterthan, and lessthan.
Predicates
Gets or sets the child predicates that compose a complex filter.
Declaration
[JsonPropertyName("predicates")]
public List<FilterRequest>? Predicates { get; set; }
Property Value
| Type | Description |
|---|---|
| List<FilterRequest> | A List<T> containing nested FilterRequest instances, or null when no child predicates exist. |
Value
Gets or sets the value used by the filter condition.
Declaration
[JsonPropertyName("value")]
public object? Value { get; set; }
Property Value
| Type | Description |
|---|---|
| object | An object containing the filter value, or null when no value is specified. |
Methods
And(FilterRequest)
Combines the current filter with the specified filter using an AND condition.
Declaration
public FilterRequest And(FilterRequest predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterRequest | predicate | The filter to combine with the current filter. |
Returns
| Type | Description |
|---|---|
| FilterRequest | A FilterRequest representing a composite filter that combines both filter expressions using an AND operator. |
Remarks
And(List<FilterRequest>)
Creates a composite filter by combining the specified predicates using an AND condition.
Declaration
public static FilterRequest And(List<FilterRequest> predicates)
Parameters
| Type | Name | Description |
|---|---|---|
| List<FilterRequest> | predicates | The collection of filter predicates to combine. |
Returns
| Type | Description |
|---|---|
| FilterRequest | A FilterRequest representing a complex filter containing the specified predicates joined by an AND condition. |
Remarks
And(string, string, object, bool, bool)
Combines the current filter with a new filter condition using an AND condition.
Declaration
public FilterRequest And(string fieldName, string @operator = null, object value = null, bool ignoreCase = false, bool ignoreAccent = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldName | The name of the field to filter. |
| string | operator | The comparison operator for the filter condition. |
| object | value | The value to compare against. |
| bool | ignoreCase | true to perform case-insensitive filtering; otherwise, false. |
| bool | ignoreAccent | true to ignore accent and diacritic characters; otherwise, false. |
Returns
| Type | Description |
|---|---|
| FilterRequest | A FilterRequest representing a composite filter that combines the current filter and the specified condition using an AND operator. |
Or(FilterRequest)
Combines the current filter with the specified filter using an OR condition.
Declaration
public FilterRequest Or(FilterRequest predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterRequest | predicate | The filter to combine with the current filter. |
Returns
| Type | Description |
|---|---|
| FilterRequest | A FilterRequest representing a composite filter that combines both filter expressions using an OR operator. |
Remarks
Or(List<FilterRequest>)
Creates a composite filter by combining the specified predicates using an OR condition.
Declaration
public static FilterRequest Or(List<FilterRequest> predicates)
Parameters
| Type | Name | Description |
|---|---|---|
| List<FilterRequest> | predicates | The collection of filter predicates to combine. |
Returns
| Type | Description |
|---|---|
| FilterRequest | A FilterRequest representing a complex filter containing the specified predicates joined by an OR condition. |
Remarks
Or(string, string, object, bool, bool)
Combines the current filter with a new filter condition using an OR condition.
Declaration
public FilterRequest Or(string fieldName, string @operator = null, object value = null, bool ignoreCase = false, bool ignoreAccent = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldName | The name of the field to filter. |
| string | operator | The comparison operator for the filter condition. |
| object | value | The value to compare against. |
| bool | ignoreCase | true to perform case-insensitive filtering; otherwise, false. |
| bool | ignoreAccent | true to ignore accent and diacritic characters; otherwise, false. |
Returns
| Type | Description |
|---|---|
| FilterRequest | A FilterRequest representing a composite filter that combines the current filter and the specified condition using an OR operator. |