# Basic Selection

**RadGridView** provides you with selection functionality, which allows the user to select one or more rows and/or cells from the data displayed by the control.

> tip The selection mechanism can be controlled programmatically too. For more information take a look at the [Programmatic Selection](https://www.telerik.com/products/wpf/documentation/controls/radgridview/selection/programmatic-selection) article.

Users can select an item in through the control's UI by clicking somewhere on the desired row.

> caption Row selection

![Telerik UI for WPF RadGridView showing full row selection](https://www.telerik.com/products/wpf/documentation/assets/11d28fa9641c970ea39f65df1d46537f/radgridview_basicselection_1.png)

If enabled, users can also select a single cell or multiple cells as shown in **Figure 2**.

> caption Cell selection

![Telerik UI for WPF RadGridView showing individual cell selection](https://www.telerik.com/products/wpf/documentation/assets/4b4a55b489ae7d89d828c0a128ae48ec/radgridview_basicselection_2.png)

To set the selection unit, use the **SelectionUnit** enumeration property of the RadGridView. Setting it to **FullRow** will enable the selection of rows (default) while setting it to **Cell** will enable the cell selection.

## Selection Modes

The **RadGridView** control provides three selection modes, which allow you to manipulate the type of selection. This is controlled by the **SelectionMode** enumeration property which has the following values:

* **Single**: Only one item can be selected at a time. **(default value)**

* **Multiple**: Items are added to the selection when they get clicked and get removed when they get clicked again.

* **Extended**: Items are added to the selection only by combining the mouse clicks with the **Ctrl** or **Shift** keys.

> tip To learn more about the multiple selections (the **Multiple** and **Extended** selection modes) take a look at the [Multiple Selection](https://www.telerik.com/products/wpf/documentation/controls/radgridview/selection/multiple-selection) topic.

## Selection Units

**RadGridView** also provides three selection units, which allow you to manipulate what units are selected when you interact with the grid. This is controlled by the **SelectionUnit** enumeration property which has the following values:

* **FullRow**: This is the default value. Clicking within the cells will select the whole row.
* **Cell**: Only the clicked cell is selected. Depending on the value of the **SelectionMode** property you can have more than one selected cell.
* **Mixed**: You can select both cells and rows. To select a row you should click either on the **row indicator** or outside any cells in the row.

## Selected items

**RadGridView** provides several properties to get the data behind the selected items - **SelectedItem**, **SelectedItems** and **SelectedCells**.

* **SelectedItem**: The business object corresponding to the selected row. If the **SelectionUnit** is **Cell** or no full rows have been selected, it's value is **null**.
* **SelectedItems**: A collection of the business objects corresponding to the selected rows. If the **SelectionUnit** is **Cell** or no full rows have been selected, the collection is empty.
* **SelectedCells**: A collection of **GridViewCellInfo** objects which represent the corresponding business object(s) and the column(s) of the selected cell(s).

> important When filtering is applied to the control, if a currently selected item does not pass the filtering criteria, it will be deselected.

## Disabling Selection

To disable the selection functionality you can set the **CanUserSelect** property to **False**.

> This will only disable the selection. The user will still be able to change the current item.

> This will disable the selection only for the end-user. It will still be possible to manipulate the selection programmatically.

**Example 1: Set the CanUserSelect property in XAML**

```XAML
<telerik:RadGridView x:Name="radGridView"
                 CanUserSelect="False">
</telerik:RadGridView>
```

**Example 1: Set the CanUserSelect property in code-behind**

```C#
this.radGridView.CanUserSelect = false;
```

```VB.NET
Me.radGridView.CanUserSelect = False
```

## DragElementAction

When the **SelectionMode** is **Extended**, you can set the **DragElementAction** property of the RadGridView in order to specify the action that will be taken when the user performs a drag over the GridViewRows. This property is of type [DragAction](https://docs.telerik.com/devtools/wpf/api/telerik.windows.controls.gridview.selection.dragaction) and has the following values:

* **ExtendedSelect**: Performs selection without taking the drag unit selection state.
* **None**: Does not execute any action.
* **Select**: Performs selection. This mode does not perform selection when dragging from a unit that is selected.

## Events

There are five events relevant to the selection functionality in the RadGridView - **SelectionChanging, SelectionChanged, CurrentCellInfoChanged, SelectedCellsChanging and SelectedCellsChanged**. To learn more about each of them go to the [Selection Events](https://www.telerik.com/products/wpf/documentation/controls/radgridview/events/selection-events) article.

## See Also

* [Multiple Selection](https://www.telerik.com/products/wpf/documentation/controls/radgridview/selection/multiple-selection)
* [Programmatic Selection](https://www.telerik.com/products/wpf/documentation/controls/radgridview/selection/programmatic-selection)
* [Basic Filtering](https://www.telerik.com/products/wpf/documentation/controls/radgridview/filtering/basic)
* [Programmatic Filtering](https://www.telerik.com/products/wpf/documentation/controls/radgridview/filtering/programmatic)
