Skip to content

Commit 60426ae

Browse files
docs(treelist): Add Cell Selection documentation and revamp Selection… (#2302)
* docs(treelist): Add Cell Selection documentation and revamp Selection articles * docs(treelist): Selection polishing --------- Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com>
1 parent b9cf233 commit 60426ae

File tree

11 files changed

+535
-1092
lines changed

11 files changed

+535
-1092
lines changed

components/grid/events.md

+4
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,14 @@ Make sure to update the current page size when using the event.
10581058

10591059
Fires when [row selection is enabled]({%slug grid-selection-overview%}#enable-row-or-cell-selection) and the user selects or deselects one row or multiple rows, depending on the [selection mode]({%slug grid-selection-overview%}#use-single-or-multiple-selection).
10601060

1061+
Visit the [Grid Row Selection article to see an example]({%slug grid-selection-row%}#selecteditemschanged-event).
1062+
10611063
## SelectedCellsChanged
10621064

10631065
Fires when [cell selection is enabled]({%slug grid-selection-overview%}#enable-row-or-cell-selection) and the user selects or deselects one cell or multiple cells, depending on the [selection mode]({%slug grid-selection-overview%}#use-single-or-multiple-selection).
10641066

1067+
Visit the [Grid Cell Selection article to see an example]({%slug grid-selection-cell%}#selectedcellschanged-event).
1068+
10651069
## See Also
10661070

10671071
* [Grid Overview]({%slug grid-overview%})

components/grid/selection/cells.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Cell Selection
33
page_title: Grid - Cells Selection
4-
description: Learn how to select cell in Blazor Grid component. Explore the selected cells. Discover cell selection bevahior when combined with other Grid features. Try the practical sample code for cell selection.
4+
description: Learn how to select cell in Blazor Grid component. Explore the selected cells. Discover cell selection bevahior when combined with other Grid features. Try the practical sample code for cell selection.
55
slug: grid-selection-cell
66
tags: telerik,blazor,grid,selection,cells
77
position: 5
@@ -190,7 +190,7 @@ The `GridSelectedCellDescriptor` type exposes the following properties:
190190

191191
When the Grid `Data` collection changes, the `SelectedCells` collection has the following behavior:
192192

193-
* When the user updates a selected cell and the item instance is replaced, you have to also replace the `SelectedCellDescriptor.DataItem` object in the `SelectedCells` collection. Do that in the [Grid `OnUpdate` event]({%slug components/grid/editing/overview%}#events).
193+
* When the user updates a selected cell and the item instance is replaced, you have to also replace the `DataItem` object in the `SelectedCells` collection. Do that in the [Grid `OnUpdate` event]({%slug components/grid/editing/overview%}#events).
194194
* When the user deletes a row with selected cells, update the `SelectedCells` collection in the the Grid `OnDelete` event handler.
195195
* To select cells from a new item in the Grid you can use the [`OnCreate` event]({%slug components/grid/editing/overview%}#events) to update the `SelectedCells` collection.
196196

components/grid/selection/overview.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ You can configure the Grid either for row or cell selection:
2727
* Add a `<GridSelectionSettings>` tag to the `<GridSettings>` tag, and set the `SelectionType` parameter to `GridSelectionType.Row`.
2828
* Optionally, you can also select rows through the [checkbox column]({%slug components/grid/columns/checkbox%}).
2929
* To enable cell selection:
30-
* Add a `<GridSelectionSettings>` tag to the `<GridSettings>` tag, and set the `SelectionType` parameter to the `Cell` member of the `Telerik.Blazor.GridSelectionType` enum.
30+
* Add a `<GridSelectionSettings>` tag to the `<GridSettings>` tag, and set the `SelectionType` parameter to `GridSelectionType.Cell`.
3131

32-
See [Rows Selection Options]({%slug grid-selection-row%}#basics) and [Cells Selection Options]({%slug grid-selection-cell%}#basics) for more details.
32+
See [Rows Selection Basics]({%slug grid-selection-row%}#basics) and [Cells Selection Basics]({%slug grid-selection-cell%}#basics) for more details.
3333

3434
## Use Single or Multiple Selection
3535

@@ -48,14 +48,14 @@ The Grid exposes two parameters to get or set its selected rows and cells.
4848

4949
Both parameters support two-way binding. You can also use the parameters to pre-select rows or cells for your users.
5050

51-
See [Selected Rows]({%slug grid-selection-row%}#selected-rows) and [Selected Cells]({%slug grid-selection-cell%}#selected-cells) for more details.
51+
See [Rows Selection Basics]({%slug grid-selection-row%}#basics) and [Cells Selection Basics]({%slug grid-selection-cell%}#basics) for more details.
5252

5353
## Events
5454

5555
You can respond to the user action of selecting a new item through the Grid events:
5656

57-
* Use the [`SelectedItemsChanged` event]({%slug grid-selection-row%}#selecteditemschanged) to respond to row selection.
58-
* Use the [`SelectedCellsChanged` event]({%slug grid-selection-cell%}#selectedcellschanged) to respond to cell selection.
57+
* Use the [`SelectedItemsChanged` event]({%slug grid-selection-row%}#selecteditemschanged-event) to respond to row selection.
58+
* Use the [`SelectedCellsChanged` event]({%slug grid-selection-cell%}#selectedcellschanged-event) to respond to cell selection.
5959

6060
## Integration with Other Grid Features
6161

components/grid/selection/rows.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ You can respond to user selection actions through the `SelectedItemsChanged` eve
8181
>caption Using the Grid SelectedItemsChanged event
8282
8383
````CSHTML
84+
@* Select rows and handle the SelectedItemsChanged event *@
85+
8486
<TelerikGrid Data="@GridData"
8587
SelectionMode="@GridSelectionMode.Multiple"
8688
SelectedItems="@SelectedEmployees"
@@ -153,7 +155,7 @@ The `SelectedItemsChanged` event handler cannot be awaited. To execute asynchron
153155
When the Grid `Data` collection changes, the `SelectedItems` collection has the following behavior:
154156

155157
* When the user updates a selected item and the item instance is replaced, you have to also replace the selected item object in the `SelectedItems` collection. Do that in the [Grid `OnUpdate` event]({%slug components/grid/editing/overview%}#events).
156-
* When the user deletes a selected item, the Grid automatically deletes it from the `SelectedItems` collection and the [`SelectedItemsChanged` event](#selecteditemschanged) fires.
158+
* When the user deletes a selected item, the Grid automatically deletes it from the `SelectedItems` collection and the [`SelectedItemsChanged` event](#selecteditemschanged-event) fires.
157159
* To select a new item in the Grid you can use the [`OnCreate` event]({%slug components/grid/editing/overview%}#events) to update the `SelectedItems` collection.
158160

159161
## Equals Comparison

components/treelist/columns/checkbox.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The TreeList checkbox column has the following exclusive parameters. For other a
2323
| Parameter | Type and Default&nbsp;Value | Description |
2424
| --- | --- | --- |
2525
| `CheckBoxOnlySelection` | `bool` | Determines if row selection occurs only on checkbox clicks. By default, user can select rows by clicking anywhere, except on command buttons. |
26-
| `SelectAll` | `bool` <br /> (`true`) | Determines if the column header renders a checkbox to select all rows. Set this to `false` if the [TreeList `SelectionMode` is `Single`]({%slug treelist-selection-single%}). The `SelectAll` parameter has no effect when the checkbox column has a [`HeaderTemplate`](#headertemplate). |
26+
| `SelectAll` | `bool` <br /> (`true`) | Determines if the column header renders a checkbox to select all rows. Set this to `false` if the [TreeList `SelectionMode` is `Single`]({%slug treelist-selection-overview%}#use-single-or-multiple-selection). The `SelectAll` parameter has no effect when the checkbox column has a [`HeaderTemplate`](#headertemplate). |
2727
| `SelectAllMode` | `TreeListSelectAllMode` enum <br /> (`Current`) | Determines if the header cell checkbox selects all rows on the current page, or all rows in the TreeList. `Current` selects the visible rows on the current page. It does not select the children of collapsed items - they are not part of the [current page]({%slug treelist-paging%}) data. `All` selects all the data items, including ones that may be currently filtered out. |
2828
| `SelectChildren` | `bool` | Determines if a parent row checkbox affects the selected state of respective child rows. |
2929

components/treelist/events.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ You can read more about the CUD events in the [Editing Overview]({%slug treelist
2828
* [OnExpand and OnCollapse](#onexpand-and-oncollapse)
2929
* [Command Button Click](#command-button-click)
3030
* [SelectedItemsChanged](#selecteditemschanged)
31+
* [SelectedCellsChanged](#selectedcellschanged)
3132
* [OnModelInit](#onmodelinit)
3233
* [OnRowClick](#onrowclick)
3334
* [OnRowDoubleClick](#onrowdoubleclick)
@@ -168,7 +169,15 @@ The command buttons of a treelist provide an `OnClick` event before firing their
168169

169170
## SelectedItemsChanged
170171

171-
Fires when the item selection is enabled and the user changes the selected [item]({%slug treelist-selection-single%}#selecteditemschanged-event) or [items]({%slug treelist-selection-multiple%}#selecteditemschanged-event).
172+
Fires when [row selection is enabled]({%slug treelist-selection-overview%}#enable-row-or-cell-selection) and the user selects or deselects one or multiple rows, depending on the [selection mode]({%slug treelist-selection-overview%}#use-single-or-multiple-selection).
173+
174+
Visit the [TreeList Row Selection article to see an example]({%slug treelist-selection-row%}#selecteditemschanged-event).
175+
176+
## SelectedCellsChanged
177+
178+
Fires when [cell selection is enabled]({%slug treelist-selection-overview%}#enable-row-or-cell-selection) and the user selects or deselects one cell or multiple cells, depending on the [selection mode]({%slug treelist-selection-overview%}#use-single-or-multiple-selection).
179+
180+
Visit the [TreeList Cell Selection article to see an example]({%slug treelist-selection-cell%}#selectedcellschanged-event).
172181

173182
## OnModelInit
174183

0 commit comments

Comments
 (0)