You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article explains how to retrieve the applied filtering, searching, sorting, and grouping criteria in Blazor components. The article applies to components that support these features. The components that offer one or all of the functionalities are:
15
+
* The [Filter]({%slug filter-overview%})
16
+
* The [Gantt]({%slug gantt-overview%})
17
+
* The [TreeList]({%slug treelist-overview%})
18
+
* All components that [expose the `OnRead` event]({%slug common-features-data-binding-onread%}#components-with-onread-event).
There are two ways to obtain the applied filtering, searching, sorting, grouping criteria:
14
23
15
-
* Through the component [`OnRead` event]({%slug common-features-data-binding-onread%}) handler. Use the [`Request` property]({%slug common-features-data-binding-onread%}#event-argument) of the [event argument object](/blazor-ui/api/Telerik.Blazor.Components.ReadEventArgs):
24
+
#### Through the OnRead Event
25
+
26
+
Use the [`Request` property]({%slug common-features-data-binding-onread%}#event-argument) of the [`OnRead` event argument object](/blazor-ui/api/Telerik.Blazor.Components.ReadEventArgs):
At the bottom of the article you will find full examples.
71
+
59
72
60
-
# Filtering
73
+
##Filtering
61
74
62
75
The filtering criteria for each filtered field is stored in an individual collection of [`IFilterDescriptor`](/blazor-ui/api/Telerik.DataSource.IFilterDescriptor). To access the filtering criteria, cast each `IFilterDescriptor` to [`CompositeFilterDescriptor`](/blazor-ui/api/Telerik.DataSource.CompositeFilterDescriptor).
63
76
64
77
The `CompositeFilterDescriptor` exposes:
65
-
*[`FilterDescriptors`](/blazor-ui/api/telerik.datasource.compositefilterdescriptor#Telerik_DataSource_CompositeFilterDescriptor_FilterDescriptors) property. This property represents another collection of `IFilterDescriptor`. To get the properties of each filter descriptor instance cast the `IFilterDescriptor` to a [`FilterDescriptor`](/blazor-ui/api/telerik.datasource.filterdescriptor). Each `FilterDescriptor` instance gives access to:
78
+
*[`FilterDescriptors`](/blazor-ui/api/telerik.datasource.compositefilterdescriptor#Telerik_DataSource_CompositeFilterDescriptor_FilterDescriptors) property. This property represents another collection of `IFilterDescriptor`. To access the filtering criteria cast the `IFilterDescriptor` to a [`FilterDescriptor`](/blazor-ui/api/telerik.datasource.filterdescriptor). Each `FilterDescriptor` instance gives access to:
66
79
* The `Member`—The field where the user filters. Each filter descriptor describes also the `MemberType`, that represents the type of the field.
67
80
* The `Operator`—The [`FilterOperator`](/blazor-ui/api/telerik.datasource.filteroperator) that applies. There are different operators depending on the `MemberType`. Read more about the [filter operators]({%slug common-features-filter-operators%}).
68
81
* The `Value`—The user input to filter by.
69
-
*[`LogicalOperator`](/blazor-ui/api/telerik.datasource.compositefilterdescriptor#Telerik_DataSource_CompositeFilterDescriptor_LogicalOperator) property. This property can be either AND or OR. The logical operator applies between the filter descriptor instances.
82
+
*[`LogicalOperator`](/blazor-ui/api/telerik.datasource.compositefilterdescriptor#Telerik_DataSource_CompositeFilterDescriptor_LogicalOperator) property. This property can be either AND or OR. This property represents the logical operator applied between the instances in the `FilterDescriptors` collection.
70
83
71
84
When the filtering is initiated, the `CompositeFilterDescriptor` properties get different values, depending on the filter mode:
72
85
@@ -78,24 +91,26 @@ When the filtering is initiated, the `CompositeFilterDescriptor` properties get
78
91
| FilterRow | Two filter descriptor instances per each filtered field. The second filter descriptor instance always gets null as `Value`, because there is no second input field. | AND |
79
92
80
93
81
-
# Searching
94
+
##Searching
82
95
83
-
The searching criteria is stored in an individual `IFilterDescriptor`. To access the filtering criteria, cast the `IFilterDescriptor` to `CompositeFilterDescriptor`. The `FilterDescriptors` property of the `CompositeFilterDescriptor` gets filter descriptor instances for all string fields. Each filter descriptor instance gets the user input as `Value`. The value of the `LogicalOperator` property of the `CompositeFilterDescriptor` is OR.
96
+
The searching criteria are stored in an individual `IFilterDescriptor`. To access the filtering criteria, cast the `IFilterDescriptor` to `CompositeFilterDescriptor`. The `FilterDescriptors` property of the `CompositeFilterDescriptor` gets filter descriptor instances for all string fields. Each filter descriptor instance gets the user input as `Value`. The value of the `LogicalOperator` property of the `CompositeFilterDescriptor` is OR.
84
97
85
98
86
-
# Sorting
99
+
##Sorting
87
100
88
-
The current sorting criteria is stored in a collection of [`SortDescriptor`](/blazor-ui/api/telerik.datasource.sortdescriptor). Each `SortDescriptor` instance gives access to:
89
-
* The `Member`—The field where the user sorts.
90
-
* The `SortDirection`—The sort direction for this sort descriptor.
101
+
The sorting criteria are stored in a collection of [`SortDescriptor`](/blazor-ui/api/telerik.datasource.sortdescriptor). Each `SortDescriptor` instance gives access to:
102
+
* The `Member`—The field where the user sorts.
103
+
* The `SortDirection`—The sort direction for this sort descriptor.
91
104
92
105
93
-
# Grouping
106
+
##Grouping
94
107
95
108
Тhe grouping criteria for each group is stored in an individual collection of [`GroupDescriptor`](/blazor-ui/api/telerik.datasource.groupdescriptor). The `GroupDescriptor` class inherits the `SortDescriptor` class and gives access to the same properties as the `SortDescriptor` class.
96
109
97
110
98
-
# Example with `OnRead` Event
111
+
## Examples
112
+
113
+
#### Obtain the FilterDescriptor, SearchFilter, SortDescriptor, GroupDescriptor in the OnRead Event Handler
99
114
100
115
````CSHTML
101
116
@using Telerik.DataSource
@@ -185,7 +200,8 @@ The current sorting criteria is stored in a collection of [`SortDescriptor`](/bl
185
200
}
186
201
````
187
202
188
-
# Example Through the Component State
203
+
#### Obtain the FilterDescriptor, SearchFilter, SortDescriptor, GroupDescriptor Through the Component State
Copy file name to clipboardExpand all lines: components/autocomplete/filter.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,11 @@ position: 10
12
12
13
13
The AutoComplete component can filter the available suggestions, according to the current input. In this way users can find the desired value faster. To see the difference in behavior, visit the [Live Demo: AutoComplete Filtering](https://demos.telerik.com/blazor-ui/autocomplete/filtering) page.
14
14
15
-
To enable filtering, set the `Filterable` parameter to `true`. The filtering is case insensitive. You can also implement custom (server) filtering and set a data source dynamically through the [`OnRead` event]({%slug autocomplete-events%}#onread).
15
+
To enable filtering, set the `Filterable` parameter to `true`. The filtering is case insensitive.
16
+
17
+
You can also use the [`OnRead` event]({%slug autocomplete-events%}#onread) to:
18
+
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
19
+
* Implement custom (server) filtering and set a data source dynamically.
Copy file name to clipboardExpand all lines: components/combobox/filter.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,11 @@ position: 10
12
12
13
13
The ComboBox component allows the user to filter the available items by their text, so they can find the one they need faster.
14
14
15
-
To enable filtering, set the `Filterable` parameter to `true`. The filtering is case insensitive. You can also implement custom (server) filtering and set a data source dynamically through the [`OnRead` event]({%slug components/combobox/events%}#onread).
15
+
To enable filtering, set the `Filterable` parameter to `true`. The filtering is case insensitive.
16
+
17
+
You can also use the [`OnRead` event]({%slug components/combobox/events%}#onread) to:
18
+
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
19
+
* Implement custom (server) filtering and set a data source dynamically.
16
20
17
21
Filtering looks in the `TextField`, and the filter is reset when the dropdown closes.
0 commit comments