Articles in this section
Category / Section

How to select the multiple rows on the WPF SfDataGrid ?

3 mins read

SfDataGrid supports two types of Selection behavior such as, Row Selection and Cell Selection. You can do the Row selection by setting SelectionUnit to Row and Cell selection by setting SelectionUnit to Cell.

The following selection modes are provided for Row Selection and Cell Selection.

Single: It is used to select a single row or cell.

Multiple: It is used to select multiple rows or cells without holding down a modifier key.

Extended: It is used to select multiple rows or cells when holding down “SHIFT” and “CTRL” keys.

None: It disables a selection.

 

The following code sample explains you multiple row selection.

XAML

<syncfusion:SfDataGrid x:Name="dataGrid"
                        AutoGenerateColumns="False"
                        NavigationMode="Row"
                        SelectionMode="Multiple"
                        SelectionUnit="Row"
                        ItemsSource="{Binding Path=OrdersDetails}">
</syncfusion:SfDataGrid>

 

You can make multiple row selection by setting SelectionMode property to Multiple, SelectionUnit property to Row and NavigationMode property to Row.

The following screenshot displays the multiple selection of rows.

F:\KB\RowSeletion.png

The following code sample explains you multiple cell selection.

XAML

<syncfusion:SfDataGrid x:Name="dataGrid"
                        AutoGenerateColumns="False"
                        SelectionMode="Multiple"
                        SelectionUnit="Cell"
                        ItemsSource="{Binding Path=OrdersDetails}">
</syncfusion:SfDataGrid>

 

You can make multiple cell selection by setting SelectionMode property to Multiple and SelectionUnit property to Cell.

The following screenshot displays the multiple selection of cells,

F:\KB\CellSelection.png

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied