Skip to content

Commit 1129a2d

Browse files
committed
Code changes regarding Extended Selection User guide.
1 parent 406c396 commit 1129a2d

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed
17.5 KB
Loading

MAUI/DataGrid/selection.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ The Keyboard navigation through the cells and rows is determined based on the [N
8383
<td> {{'[SingleDeselect](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridSelectionMode.html#Syncfusion_Maui_DataGrid_DataGridSelectionMode_SingleDeselect)'| markdownify }} </td>
8484
<td> Allows selection of a single row or cell only. However, upon tapping the row or cell again, the selection is cleared. Similar to single mode, upon selecting the next row or cell, the selection in the previous row or cell is cleared. </td>
8585
</tr>
86+
<td> {{'[Extended]()'| markdownify }} </td>
87+
<td> Allows selecting multiple rows or cells. You can select multiple rows or cells in the SfDataGrid by dragging the mouse or by using the key modifiers <kbd>Ctrl</kbd> and <kbd>Shift</kbd>. </td>
88+
</tr>
8689
</table>
8790

8891
## Disable selection for rows and columns
@@ -383,6 +386,124 @@ The selected rows will be deleted.
383386
</tr>
384387
</table>
385388

389+
## Multiple Row or Cell Selection
390+
391+
The `SfDataGrid` allows you to select multiple rows or cells by setting `SelectionMode` property as [Extended](), where you can select multiple rows or cells by dragging the mouse on SfDataGrid and also using the key modifiers.
392+
393+
While using `Extended`, you can select multiple rows or cells by pressing the key modifiers <kbd>Ctrl</kbd> and <kbd>Shift</kbd>.
394+
395+
{% tabs %}
396+
{% highlight xaml %}
397+
<syncfusion:SfDataGrid x:Name="dataGrid"
398+
SelectionUnit="Cell"
399+
NavigationMode="Cell"
400+
SelectionMode="Extended"
401+
ItemsSource="{Binding Orders}">
402+
{% endhighlight %}
403+
{% endtabs %}
404+
405+
<img alt="Extended selection support in .NET MAUI DataGrid" src="Images\selection\maui-dataGrid-extendedSelection.png" width="404"/>
406+
407+
## Shift and ctrl Key Combinations
408+
409+
When the `SelectionMode` is set to [Extended](), you can select multiple rows or cells using the navigation keys together with the <kbd>Shift</kbd> key. Before navigation begins, the current cell is marked as the pressed (anchor) cell, and the selection includes all rows or cells between the pressed cell and the current cell.
410+
411+
<table>
412+
<tr>
413+
<th>
414+
Key Combinations
415+
</th>
416+
</tr>
417+
<tr>
418+
<td>
419+
<kbd>Shift</kbd> + <kbd>DownArrow</kbd>
420+
</td>
421+
</tr>
422+
<tr>
423+
<td>
424+
<kbd>Shift</kbd> + <kbd>UpArrow</kbd>
425+
</td>
426+
</tr>
427+
<tr>
428+
<td>
429+
<kbd>Shift</kbd> + <kbd>RightArrow</kbd>
430+
</td>
431+
</tr>
432+
<tr>
433+
<td>
434+
<kbd>Shift</kbd> + <kbd>LeftArrow</kbd>
435+
</td>
436+
</tr>
437+
<tr>
438+
<td>
439+
<kbd>Shift</kbd> + <kbd>Home</kbd>
440+
</td>
441+
</tr>
442+
<tr>
443+
<td>
444+
<kbd>Shift</kbd> +<kbd> End</kbd>
445+
</td>
446+
</tr>
447+
<tr>
448+
<td>
449+
<kbd>Shift</kbd> + <kbd>PageDown</kbd>
450+
</td>
451+
</tr>
452+
<tr>
453+
<td>
454+
<kbd>Shift</kbd> + <kbd>PageUp</kbd>
455+
</td>
456+
</tr>
457+
<tr>
458+
<td>
459+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>DownArrow</kbd>
460+
</td>
461+
</tr>
462+
<tr>
463+
<td>
464+
<kbd>Shift</kbd> + <kbd> Ctrl</kbd> + <kbd>UpArrow</kbd>
465+
</td>
466+
</tr>
467+
<tr>
468+
<td>
469+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>RightArrow</kbd>
470+
</td>
471+
</tr>
472+
<tr>
473+
<td>
474+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>LeftArrow</kbd>
475+
</td>
476+
</tr>
477+
<tr>
478+
<td>
479+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>Home</kbd>
480+
</td>
481+
</tr>
482+
<tr>
483+
<td>
484+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>End</kbd>
485+
</td>
486+
</tr>
487+
<tr>
488+
<td>
489+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>PageDown</kbd>
490+
</td>
491+
</tr>
492+
<tr>
493+
<td>
494+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>PageUp</kbd>
495+
</td>
496+
</tr>
497+
</table>
498+
499+
## Extended Selection Limitations.
500+
501+
The `Extended Selection` in [SfDataGrid](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.html) has certain limitations that should be considered while using this feature:
502+
503+
- Drag selection using the mouse pointer is not supported on Android or iOS.
504+
- Drag selection cannot be used together with PullToRefresh, Swiping, or Row drag-and-drop features.
505+
- Extended selection is not supported in the master-details view.
506+
386507
## Move Current Cell
387508
The [CurrentCell](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html#Syncfusion_Maui_DataGrid_SfDataGrid_CurrentCell) can be moved to a particular [RowColumnIndex](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.GridCommon.ScrollAxis.RowColumnIndex.html) by using the [SfDataGrid.MoveCurrentCellTo()](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html#Syncfusion_Maui_DataGrid_SfDataGrid_MoveCurrentCellTo_Syncfusion_Maui_GridCommon_ScrollAxis_RowColumnIndex_System_Boolean_) method. This method is not applicable when the `SfDataGrid.SelectionMode` is None or the `NavigationMode` is Row.
388509

0 commit comments

Comments
 (0)