Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7c9548b
docs(common):Create common article for descriptors
NansiYancheva Oct 8, 2024
0049a35
Update components/gantt/gantt-tree/filter/overview.md
NansiYancheva Oct 14, 2024
995d049
revamp by adding all descriptors
NansiYancheva Oct 15, 2024
3eab836
revamp main and refer related articles
NansiYancheva Oct 18, 2024
7a4d238
update common article
NansiYancheva Oct 21, 2024
5308b44
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 21, 2024
1aa3130
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 21, 2024
de0bd4d
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 21, 2024
990e0ed
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 21, 2024
00ffc44
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 21, 2024
718ae0d
Update components/filter/overview.md
NansiYancheva Oct 21, 2024
c6b287e
update after review
NansiYancheva Oct 21, 2024
754fe04
update after support review
NansiYancheva Oct 22, 2024
efa5736
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
ae7ed26
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
1065253
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
dfcd925
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
94fa2e2
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
ca6a715
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
0352538
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
58ba27c
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
5844650
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
6db2252
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
7caa380
Update common-features/data-binding/descriptors.md
NansiYancheva Oct 22, 2024
0e3247b
update after tech writer review
NansiYancheva Oct 22, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update after review
  • Loading branch information
NansiYancheva committed Oct 21, 2024
commit c6b287ea45b5d5c0cea9c281fd8b1102e19d8889
27 changes: 15 additions & 12 deletions common-features/data-binding/descriptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ position: 10
---


## Components with Descriptors
## Data Operation Descriptors

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:

* [Components that [expose an `OnRead` event]({%slug common-features-data-binding-onread%}#components-with-onread-event), excluding the [ListView]({%slug listview-overview%}), because the ListView doesn't support built-in filtering, searching, sorting, and grouping.
* Components that [expose an `OnRead` event]({%slug common-features-data-binding-onread%}#components-with-onread-event), excluding the [ListView]({%slug listview-overview%}), because the ListView doesn't support built-in filtering, searching, sorting, and grouping.
* [Filter]({%slug filter-overview%})
* [Gantt]({%slug gantt-overview%})
* [TreeList]({%slug treelist-overview%})
Expand Down Expand Up @@ -44,8 +44,9 @@ async Task OnReadHandler(...ReadEventArgs args)
}
````

#### Through the Component State
Use the component state property of the `OnStateChanged` event argument. For example:
### Through the Component State

Use the component state property of the `OnStateChanged` event argument. This approach is applicable for the Gantt, the Grid and the TreeList, because they expose the state feature. For example:

````CS
async Task OnStateChangedHandler(GridStateEventArgs<Product> args)
Expand All @@ -68,21 +69,21 @@ async Task OnStateChangedHandler(GridStateEventArgs<Product> args)
}
````

At the bottom of the article you will find full examples.
See full examples at the bottom of the article.


## Filtering

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, such as the user input to filter by, cast each `IFilterDescriptor`:
The filtering criteria for each filtered field are stored in an individual collection of [`IFilterDescriptor`](/blazor-ui/api/Telerik.DataSource.IFilterDescriptor). To access the filtering criteria, such as the user input to filter by, cast each `IFilterDescriptor`:

* If the component is of type input or select, such as the AutoComplete, the ComboBox, the DropDownList, the MultiColumnComboBox, the MultiSelect, cast each `IFilterDescriptor` to [`FilterDescriptor`](/blazor-ui/api/telerik.datasource.filterdescriptor).
* If the component is of type input or select, such as the AutoComplete, the ComboBox, the DropDownList, the MultiColumnComboBox, the MultiSelect, cast the first `IFilterDescriptor` from the collection to [`FilterDescriptor`](/blazor-ui/api/telerik.datasource.filterdescriptor).
* Otherwise, cast each `IFilterDescriptor` to [`CompositeFilterDescriptor`](/blazor-ui/api/Telerik.DataSource.CompositeFilterDescriptor).

### CompositeFilterDescriptor

The `CompositeFilterDescriptor` exposes:

* [`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 each `IFilterDescriptor` to a `FilterDescriptor`.
* [`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 each `IFilterDescriptor` to a `FilterDescriptor`. When the Filter component gets groupable filtering, cast each `IFilterDescriptor` to another `CompositeFilterDescriptor`.
* [`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.

When the filtering is initiated, the `CompositeFilterDescriptor` properties get different values, depending on the filter mode:
Expand All @@ -97,7 +98,7 @@ When the filtering is initiated, the `CompositeFilterDescriptor` properties get

## Searching

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.
The searching criteria in a Grid or TreeList are stored in an individual `IFilterDescriptor`. Cast it to [`CompositeFilterDescriptor`](#compositefilterdescriptor). The `CompositeFilterDescriptor` holds one child `FilterDescriptor`s for each searchable string column. Each `FilterDescriptor` has the same `Value`, which is the user search input. The value of the `LogicalOperator` property of the `CompositeFilterDescriptor` is `Or`.


## Sorting
Expand All @@ -112,9 +113,9 @@ The sorting criteria are stored in a collection of [`SortDescriptor`](/blazor-ui
Т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.


## Examples
## Example with OnRead Event Handler

#### Obtain the FilterDescriptor, SearchFilter, SortDescriptor, GroupDescriptor in the OnRead Event Handler
You can obtain the FilterDescriptor, SortDescriptor, GroupDescriptor in the `OnRead` event handler.

````CSHTML
@using Telerik.DataSource
Expand Down Expand Up @@ -204,7 +205,9 @@ The sorting criteria are stored in a collection of [`SortDescriptor`](/blazor-ui
}
````

#### Obtain the FilterDescriptor, SearchFilter, SortDescriptor, GroupDescriptor Through the Component State
## Example with Component State

You can obtain the FilterDescriptor, SearchFilter, SortDescriptor, GroupDescriptor through the component state.

````CSHTML
@using System.Text.Json
Expand Down
10 changes: 5 additions & 5 deletions components/autocomplete/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ from model: @Role

## OnRead

You can use the he [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component according to some custom logic and according to the current user input and/or scroll position (for [virtualization]({%slug autocomplete-virtualization%})). The event fires when:
You can use the [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component according to some custom logic and according to the current user input and/or scroll position (for [virtualization]({%slug autocomplete-virtualization%})). The event fires when:

* the component initializes
* the user [filters]({%slug autocomplete-filter%})
* the user scrolls with [virtualization]({%slug autocomplete-virtualization%}) enabled
* The component initializes.
* The user [filters]({%slug autocomplete-filter%}).
* The user scrolls with [virtualization]({%slug autocomplete-virtualization%}) enabled.

You can also call remote data through async operations.

Find out how to [get the applied by the user filtering and grouping criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering and grouping criteria]({%slug common-features-descriptors%}).

When using `OnRead`, make sure to set `TItem` and `TValue`.

Expand Down
2 changes: 1 addition & 1 deletion components/autocomplete/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To enable filtering, set the `Filterable` parameter to `true`. The filtering is

You can also use the [`OnRead` event]({%slug autocomplete-events%}#onread) to:
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
* Implement custom (server) filtering and set a data source dynamically.
* Implement custom (server) filtering and set data dynamically.

## Filter Operator

Expand Down
8 changes: 4 additions & 4 deletions components/combobox/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ See the [ComboBox Overview - Selected Item]({%slug components/combobox/overview%

You can use the [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component according to some custom logic and according to the current user input and/or scroll position (for [virtualization]({%slug combobox-virtualization%})). The event fires when:

* the component initializes
* the user [filters]({%slug components/combobox/filter%})
* the user scrolls with [virtualization]({%slug combobox-virtualization%}) enabled
* The component initializes.
* The user [filters]({%slug components/combobox/filter%}).
* The user scrolls with [virtualization]({%slug combobox-virtualization%}) enabled.

You can also call remote data through `async` operations.

Find out how to [get the applied by the user filtering and grouping criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering and grouping criteria]({%slug common-features-descriptors%}).

When using `OnRead`, make sure to set `TItem` and `TValue`.

Expand Down
2 changes: 1 addition & 1 deletion components/combobox/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To enable filtering, set the `Filterable` parameter to `true`. The filtering is

You can also use the [`OnRead` event]({%slug components/combobox/events%}#onread) to:
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
* Implement custom (server) filtering and set a data source dynamically.
* Implement custom (server) filtering and set data dynamically.

Filtering looks in the `TextField`, and the filter is reset when the dropdown closes.

Expand Down
8 changes: 4 additions & 4 deletions components/dropdownlist/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ from the model: @MySelectedItem

You can use the [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component according to some custom logic and according to the current user input and/or scroll position (for [virtualization]({%slug dropdownlist-virtualization%})). The event fires when:

* the component initializes
* the user [filters]({%slug components/dropdownlist/filter%})
* the user scrolls with [virtualization]({%slug dropdownlist-virtualization%}) enabled.
* The component initializes.
* The user [filters]({%slug components/dropdownlist/filter%}).
* The user scrolls with [virtualization]({%slug dropdownlist-virtualization%}) enabled.

Find out how to [get the applied by the user filtering and grouping criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering and grouping criteria]({%slug common-features-descriptors%}).

You can also call remote data through `async` operations.

Expand Down
2 changes: 1 addition & 1 deletion components/dropdownlist/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To enable filtering, set the `Filterable` parameter to `true`. The filtering is

You can also use the [`OnRead` event]({%slug components/dropdownlist/events%}#onread) to:
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
* Implement custom (server) filtering and set a data source dynamically.
* Implement custom (server) filtering and set data dynamically.

Filtering looks in the `TextField`, and the filter is reset when the dropdown closes.

Expand Down
5 changes: 2 additions & 3 deletions components/gantt/gantt-tree/filter/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ You can filter more than one column at a time, and all filter rules will be appl

## Filter Descriptors

The filtering criteria for each filtered field are stored in an individual [`CompositeFilterDescriptor`]({%slug common-features-descriptors%}#filtering).
You can get the applied filtering criteria for each filtered field. Use the [Gantt state]({%slug gantt-state%}) to obtain the user input, the filter operator and other filtering properties. Find out how in the [Data Operation Descriptors article]({%slug common-features-descriptors%}#filtering).

## Customize The Filter Editors

You can customize the editors rendered in the Gantt
by providing the `FilterEditorType` attribute, exposed on the `<GanttColumn>`. The `FilterEditorType` attribute accepts a member of the `GanttTreeListFilterEditorType` enum:
You can customize the editors rendered in the Gantt by providing the `FilterEditorType` attribute, exposed on the `<GanttColumn>`. The `FilterEditorType` attribute accepts a member of the `GanttTreeListFilterEditorType` enum:

| Field data type | GanttTreeListFilterEditorType enum members |
|-----------------|------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion components/gantt/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ Sometimes you may want to know what the user changed in the Gantt (e.g., when th

Find out what the user changed in the Gantt through the `PropertyName` of the `GanttStateEventArgs`. Override the user action by changing and then setting your desired state.

Find out how to [get the applied by the user filtering and sorting criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering and sorting criteria]({%slug common-features-descriptors%}).

>caption Know when the Gantt state changes, which parameter changes, and amend the change

Expand Down
2 changes: 1 addition & 1 deletion components/grid/filter/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The filter menu can display a [list of checkboxes]({%slug grid-checklist-filter%

## Filter Descriptors

The filtering criteria for each filtered field are stored in an individual [`CompositeFilterDescriptor`]({%slug common-features-descriptors%}#filtering).
You can get the applied filtering criteria for each filtered field. Use the [Grid state]({%slug grid-state%}) or the [Grid `OnRead` event handler]({%slug grid-events%}#read-event) to obtain the user input, the filter operator and other filtering properties. Find out how in the [Data Operation Descriptors article]({%slug common-features-descriptors%}#filtering).

## Custom Filtering

Expand Down
2 changes: 1 addition & 1 deletion components/grid/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Here is some additional information about certain `PropertyName` values:

To observe the changes in the Grid state more easily, copy and run the following example in a local app and at full screen.

Find out how to [get the applied by the user filtering, sorting and grouping criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering, sorting and grouping criteria]({%slug common-features-descriptors%}).

>caption Using Grid OnStateChanged

Expand Down
8 changes: 4 additions & 4 deletions components/multicolumncombobox/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ See the [MultiColumnComboBox Overview - Selected Item]({%slug multicolumncombobo

You can use the `OnRead` event to provide data to the component according to some custom logic, the user input, or the current [virtual scroll]({%slug multicolumncombobox-virtualization%}) position. The event fires when:

* the component initializes
* the user [filters]({%slug multicolumncombobox-filter%})
* the user scrolls with [virtualization]({%slug multicolumncombobox-virtualization%}) enabled
* The component initializes.
* The user [filters]({%slug multicolumncombobox-filter%}).
* The user scrolls with [virtualization]({%slug multicolumncombobox-virtualization%}) enabled.

You can also call remote data through `async` operations.

Find out how to [get the applied by the user filtering and grouping criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied by filtering and grouping criteria]({%slug common-features-descriptors%}).

When using `OnRead`, make sure to set `TItem` and `TValue`.

Expand Down
2 changes: 1 addition & 1 deletion components/multicolumncombobox/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To enable filtering, set the `Filterable` parameter to `true`. The filtering is

You can also use the [`OnRead` event]({%slug multicolumncombobox-events%}#onread) to:
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
* Implement custom (server) filtering and set a data source dynamically.
* Implement custom (server) filtering and set data dynamically.

Filtering looks in the `TextField`, and the filter is reset when the dropdown closes.

Expand Down
8 changes: 4 additions & 4 deletions components/multiselect/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ from the model:

You can use the he [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component according to some custom logic and according to the current user input and/or scroll position (for [virtualization]({%slug multiselect-virtualization%})). The event fires when:

* the component initializes
* the user [filters]({%slug multiselect-filter%})
* the user scrolls with [virtualization]({%slug dropdownlist-virtualization%}) enabled
* The component initializes.
* The user [filters]({%slug multiselect-filter%}).
* The user scrolls with [virtualization]({%slug dropdownlist-virtualization%}) enabled.

You can also call remote data through async operations.

Find out how to [get the applied by the user filtering and grouping criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering and grouping criteria]({%slug common-features-descriptors%}).

>caption Custom Data according to the user input in the MultiSelect

Expand Down
2 changes: 1 addition & 1 deletion components/multiselect/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To enable filtering, set the `Filterable` parameter to `true`. The filtering is

You can also use the [`OnRead` event]({%slug multiselect-events%}#onread) to:
* Get the [applied filtering criteria]({%slug common-features-descriptors%}#through-the-onread-event).
* Implement custom (server) filtering and set a data source dynamically.
* Implement custom (server) filtering and set data dynamically.

Filtering looks in the `TextField`, and the filter is reset when the dropdown closes.

Expand Down
2 changes: 1 addition & 1 deletion components/treelist/filter/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In addition to the two main filtering modes, the treelist offers two more featur

## Filter Descriptors

The filtering criteria for each filtered field are stored in an individual [`CompositeFilterDescriptor`]({%slug common-features-descriptors%}#filtering).
You can get the applied filtering criteria for each filtered field. Use the [TreeList state]({%slug treelist-state%}) to obtain the user input, the filter operator and other filtering properties. Find out how in the [Data Operation Descriptors article]({%slug common-features-descriptors%}#filtering).

## Customize The Filter Editors

Expand Down
2 changes: 1 addition & 1 deletion components/treelist/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ Sometimes you may want to know what the user changed in the TreeList (e.g., when

The example below shows how to achieve it by using the`OnStateChanged` event.

Find out how to [get the applied by the user filtering and sorting criteria]({%slug common-features-descriptors%}).
Find out how to [get the applied filtering and sorting criteria]({%slug common-features-descriptors%}).

>caption Know when the TreeList state changes, which parameter changed and amend the change

Expand Down
Loading