Skip to content

Commit 97110d0

Browse files
Merge pull request #3842 from syncfusion-content/MAUI_ExtendedUG
MAUI - [Dev Ug] Prepared the UG documentation for Extended Selection support.
2 parents 8f81005 + 977f18d commit 97110d0

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed
17.5 KB
Loading

MAUI/DataGrid/selection.md

Lines changed: 124 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,127 @@ 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 the `SelectionMode` property to [Extended](). This enables selection of multiple rows or cells by dragging the mouse or by clicking while holding modifier keys such as <kbd>Ctrl</kbd> and <kbd>Shift</kbd>.
392+
393+
{% tabs %}
394+
{% highlight xaml %}
395+
<syncfusion:SfDataGrid x:Name="dataGrid"
396+
SelectionUnit="Cell"
397+
NavigationMode="Cell"
398+
SelectionMode="Extended"
399+
ItemsSource="{Binding Orders}">
400+
{% endhighlight %}
401+
402+
{% highlight c# %}
403+
this.dataGrid.SelectionUnit = DataGridSelectionUnit.Cell;
404+
this.dataGrid.NavigationMode = DataGridNavigationMode.Cell;
405+
this.dataGrid.SelectionMode = DataGridSelectionMode.Extended;
406+
{% endhighlight %}
407+
{% endtabs %}
408+
409+
<img alt="Extended selection support in .NET MAUI DataGrid" src="Images\selection\maui-dataGrid-extendedSelection.png" width="404"/>
410+
411+
## Shift and ctrl Key Combinations
412+
413+
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.
414+
415+
<table>
416+
<tr>
417+
<th>
418+
Key Combinations
419+
</th>
420+
</tr>
421+
<tr>
422+
<td>
423+
<kbd>Shift</kbd> + <kbd>DownArrow</kbd>
424+
</td>
425+
</tr>
426+
<tr>
427+
<td>
428+
<kbd>Shift</kbd> + <kbd>UpArrow</kbd>
429+
</td>
430+
</tr>
431+
<tr>
432+
<td>
433+
<kbd>Shift</kbd> + <kbd>RightArrow</kbd>
434+
</td>
435+
</tr>
436+
<tr>
437+
<td>
438+
<kbd>Shift</kbd> + <kbd>LeftArrow</kbd>
439+
</td>
440+
</tr>
441+
<tr>
442+
<td>
443+
<kbd>Shift</kbd> + <kbd>Home</kbd>
444+
</td>
445+
</tr>
446+
<tr>
447+
<td>
448+
<kbd>Shift</kbd> +<kbd> End</kbd>
449+
</td>
450+
</tr>
451+
<tr>
452+
<td>
453+
<kbd>Shift</kbd> + <kbd>PageDown</kbd>
454+
</td>
455+
</tr>
456+
<tr>
457+
<td>
458+
<kbd>Shift</kbd> + <kbd>PageUp</kbd>
459+
</td>
460+
</tr>
461+
<tr>
462+
<td>
463+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>DownArrow</kbd>
464+
</td>
465+
</tr>
466+
<tr>
467+
<td>
468+
<kbd>Shift</kbd> + <kbd> Ctrl</kbd> + <kbd>UpArrow</kbd>
469+
</td>
470+
</tr>
471+
<tr>
472+
<td>
473+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>RightArrow</kbd>
474+
</td>
475+
</tr>
476+
<tr>
477+
<td>
478+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>LeftArrow</kbd>
479+
</td>
480+
</tr>
481+
<tr>
482+
<td>
483+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>Home</kbd>
484+
</td>
485+
</tr>
486+
<tr>
487+
<td>
488+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>End</kbd>
489+
</td>
490+
</tr>
491+
<tr>
492+
<td>
493+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>PageDown</kbd>
494+
</td>
495+
</tr>
496+
<tr>
497+
<td>
498+
<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>PageUp</kbd>
499+
</td>
500+
</tr>
501+
</table>
502+
503+
## Extended Selection Limitations
504+
505+
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:
506+
507+
- Drag selection using the mouse pointer is not supported on Android or iOS.
508+
- Drag selection cannot be used together with PullToRefresh, Swiping, or Row drag-and-drop features.
509+
386510
## Move Current Cell
387511
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.
388512

0 commit comments

Comments
 (0)