Skip to content

Commit b450f30

Browse files
NansiYanchevaNansiYancheva
authored andcommitted
update after tech writer review
1 parent cf0102d commit b450f30

File tree

4 files changed

+43
-26
lines changed

4 files changed

+43
-26
lines changed

common-features/data-binding/descriptors.md

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,50 +36,52 @@ async Task OnReadHandler(...ReadEventArgs args)
3636
// args.Request.Filters
3737
3838
// Get the applied grouping criteria, including:
39-
// *the field by which the user groups
40-
// *the sort direction of the groups ordering
39+
// *The field by which the user groups.
40+
// *The sort direction of the groups ordering.
4141
// args.Request.Groups
4242
4343
// Get the applied sorting criteria, including:
44-
// *the field which the user sorts
45-
// *the sort direction
44+
// *The field which the user sorts.
45+
// *The sort direction.
4646
// args.Request.Sorts
4747
}
4848
````
4949

50+
See the [complete example](#example-with-onread-event-handler) at the bottom of the article.
51+
5052
### Through the Component State
5153

5254
Use the component's state property of the `OnStateChanged` event argument. This approach applies to the Gantt, Grid, and TreeList because they expose the state feature. For example:
5355

5456
````CS
5557
async Task OnStateChangedHandler(GridStateEventArgs<Product> args)
5658
{
57-
// Get the applied filtering criteria
59+
// Get the applied filtering criteria.
5860
// args.GridState.FilterDescriptors
5961
60-
// Get the applied searching criteria
62+
// Get the applied searching criteria.
6163
// args.GridState.SearchFilter
6264
6365
// Get the applied grouping criteria, including:
64-
// *the field by which the user groups
65-
// *the sort direction of the groups ordering
66+
// *The field by which the user groups.
67+
// *The sort direction of the groups ordering.
6668
// args.GridState.GroupDescriptors
6769
6870
// Get the applied sorting criteria, including:
69-
// *the field which the user sorts
70-
// *the sort direction
71+
// *The field which the user sorts.
72+
// *The sort direction.
7173
// args.GridState.SortDescriptors
7274
}
7375
````
7476

75-
See full examples at the bottom of the article.
77+
See the [complete example](#example-with-component-state) at the bottom of the article.
7678

7779

7880
## Filtering
7981

8082
The `args.Request.Filters` and the `args....State.FilterDescriptors` are collections of [`IFilterDescriptor`](/blazor-ui/api/Telerik.DataSource.IFilterDescriptor). To access the filtering criteria, such as the user input to filter by, cast each `IFilterDescriptor` from the respective collection:
8183

82-
* 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).
84+
* If the component is of type input or select, such as the AutoComplete, ComboBox, DropDownList, MultiColumnComboBox, MultiSelect, cast the first `IFilterDescriptor` from the collection to [`FilterDescriptor`](/blazor-ui/api/telerik.datasource.filterdescriptor).
8385
* Otherwise, cast each `IFilterDescriptor` from the `args.Request.Filters` collection, respectively from the `args....State.FilterDescriptors` collection, to [`CompositeFilterDescriptor`](/blazor-ui/api/Telerik.DataSource.CompositeFilterDescriptor).
8486

8587
### CompositeFilterDescriptor
@@ -109,12 +111,15 @@ The searching criteria in a Grid or TreeList are stored in an individual `IFilte
109111
The sorting criteria in a Grid, TreeList or Gantt are stored in a collection of [`SortDescriptor`](/blazor-ui/api/telerik.datasource.sortdescriptor) objects. Each `SortDescriptor` instance gives access to:
110112
* The `Member`&mdash;The field where the user sorts.
111113
* The `SortDirection`&mdash;The sort direction for this sort descriptor.
114+
112115
When the [`SortMode`](/blazor-ui/api/Telerik.Blazor.SortMode) is `Multiple`, you may need to consider the order of the `SortDescriptor` instances. The first applied sorting criteria take precedence over all others. If there are equal values in the first sorted items, then those items are sorted by the following sorting criteria.
113116

114117

115118
## Grouping
116119

117-
Т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. The user may group by multiple fields. The groups for subsequent fields will be nested within their parent groups. The grouping criteria from the parent group are stored in the first `GroupDescriptor` instance from the collection.
120+
Тhe grouping criteria for each group are stored in an individual collection of [`GroupDescriptor`](/blazor-ui/api/telerik.datasource.groupdescriptor) objects. The `GroupDescriptor` class inherits the `SortDescriptor` class and gives access to the same properties as the `SortDescriptor` class.
121+
122+
The user may group by multiple fields. The groups for subsequent fields will be nested within their parent groups. The grouping criteria from the parent group are stored in the first `GroupDescriptor` instance from the collection.
118123

119124

120125
## Example with OnRead Event Handler
@@ -147,13 +152,13 @@ You can obtain the FilterDescriptor, SortDescriptor, and GroupDescriptor in the
147152
148153
149154
@code {
150-
private MarkupString ConsoleSim { get; set; } // to showcase what you get
155+
private MarkupString ConsoleSim { get; set; } //To showcase what you get.
151156
152157
private async Task OnReadHandler(GridReadEventArgs args)
153158
{
154159
string output = string.Empty;
155160
156-
//get the filtering and searching criteria
161+
//Get the filtering and searching criteria.
157162
output += "<span><strong>FILTERS:</strong><span></br>";
158163
foreach (var item in args.Request.Filters)
159164
{
@@ -169,14 +174,14 @@ You can obtain the FilterDescriptor, SortDescriptor, and GroupDescriptor in the
169174
}
170175
}
171176
172-
//get the sorting criteria
177+
//Get the sorting criteria.
173178
output += "<span><strong>SORTS:</strong><span></br>";
174179
foreach (SortDescriptor item in args.Request.Sorts)
175180
{
176181
output += $"Sorted field: {item.Member}, Sort direction: {item.SortDirection} <br />";
177182
}
178183
179-
//get the grouping criteria
184+
//Get the grouping criteria.
180185
output += "<span><strong>GROUPS:</strong><span></br>";
181186
foreach (GroupDescriptor item in args.Request.Groups)
182187
{
@@ -246,15 +251,14 @@ You can obtain the FilterDescriptor, SearchFilter, SortDescriptor, and GroupDesc
246251
{
247252
string output = string.Empty;
248253
249-
//get the searching criteria
254+
//Get the searching criteria.
250255
output += "<span><strong>SEARCHING:</strong><span></br>";
251256
var searching = args.GridState.SearchFilter;
252257
253258
if (searching is CompositeFilterDescriptor)
254259
{
255260
CompositeFilterDescriptor currSearch = searching as CompositeFilterDescriptor;
256261
output += $"START nested searching: Logical operator: {currSearch.LogicalOperator}, details:<br />";
257-
// by design, there will actually be 2 only, this showcases the concept and the types
258262
foreach (FilterDescriptor nestedSearch in currSearch.FilterDescriptors)
259263
{
260264
output += $"Search field: {nestedSearch.Member}, Search operator {nestedSearch.Operator}, Search value: {nestedSearch.Value}<br />";
@@ -263,7 +267,7 @@ You can obtain the FilterDescriptor, SearchFilter, SortDescriptor, and GroupDesc
263267
}
264268
265269
266-
//get the filtering criteria
270+
//Get the filtering criteria.
267271
output += "<span><strong>FILTERS:</strong><span></br>";
268272
269273
foreach (var item in args.GridState.FilterDescriptors)
@@ -280,14 +284,14 @@ You can obtain the FilterDescriptor, SearchFilter, SortDescriptor, and GroupDesc
280284
}
281285
}
282286
283-
//get the sorting criteria
287+
//Get the sorting criteria.
284288
output += "<span><strong>SORTS:</strong><span></br>";
285289
foreach (SortDescriptor item in args.GridState.SortDescriptors)
286290
{
287291
output += $"Sorted field: {item.Member}, Sort direction: {item.SortDirection} <br />";
288292
}
289293
290-
//get the grouping criteria
294+
//Get the grouping criteria.
291295
output += "<span><strong>GROUPS:</strong><span></br>";
292296
foreach (SortDescriptor item in args.GridState.GroupDescriptors)
293297
{
@@ -323,4 +327,17 @@ You can obtain the FilterDescriptor, SearchFilter, SortDescriptor, and GroupDesc
323327
public bool Discontinued { get; set; }
324328
}
325329
}
326-
````
330+
````
331+
332+
## See Also
333+
334+
* [AutoComplete OnRead Event]({%slug autocomplete-events%}#onread)
335+
* [ComboBox OnRead Event]({%slug components/combobox/events%}#onread)
336+
* [DropDownList OnRead Event]({%slug components/dropdownlist/events%}#onread)
337+
* [Filter Overview]({%slug filter-overview%})
338+
* [Gantt State]({%slug gantt-state%})
339+
* [Grid OnRead Event]({%slug components/grid/manual-operations%})
340+
* [Grid State]({%slug grid-state%})
341+
* [MultiColumnComboBox OnRead Event]({%slug multicolumncombobox-events%}#onread)
342+
* [MultiSelect OnRead Event]({%slug multiselect-events%}#onread)
343+
* [TreeList State]({%slug treelist-state%})

components/autocomplete/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ from model: @Role
116116

117117
## OnRead
118118

119-
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:
119+
You can use the [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component based on custom logic and the current user input and/or scroll position (when using [virtualization]({%slug autocomplete-virtualization%})). The event fires when:
120120

121121
* The component initializes.
122122
* The user [filters]({%slug autocomplete-filter%}).

components/combobox/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ See the [ComboBox Overview - Selected Item]({%slug components/combobox/overview%
175175

176176
## OnRead
177177

178-
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:
178+
You can use the [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component based on custom logic and the current user input and/or scroll position (when using [virtualization]({%slug combobox-virtualization%})). The event fires when:
179179

180180
* The component initializes.
181181
* The user [filters]({%slug components/combobox/filter%}).

components/dropdownlist/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ from the model: @MySelectedItem
9999

100100
## OnRead
101101

102-
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:
102+
You can use the [`OnRead` event]({%slug common-features-data-binding-onread%}) to provide data to the component based on custom logic and the current user input and/or scroll position (when using [virtualization]({%slug dropdownlist-virtualization%})). The event fires when:
103103

104104
* The component initializes.
105105
* The user [filters]({%slug components/dropdownlist/filter%}).

0 commit comments

Comments
 (0)