# Selection Modes

Develop powerful and lightweight web applications using ASP.NET MVC controls. Learn more about the ComponentOne MVC controls in ASP.NET MVC documentation.

## Content



By default, FlexGrid allows you to select a range of cells with the mouse or keyboard, similar to Excel. The [SelectionMode](/componentone/api/mvc/online-mvc/dotnet-framework-api/C1.Web.Mvc/C1.Web.Mvc.Grid.SelectionMode.html) property allows you to change that so that you can select a row, range of rows, multiple ranges, non-contiguous rows (like in a List-Box), single cell, range of cells or disable selection altogether.

To specify the selection behavior in FlexGrid, set the [SelectionMode](/componentone/api/mvc/online-mvc/dotnet-framework-api/C1.Web.Mvc/C1.Web.Mvc.Grid.SelectionMode.html) to:

*   **Cell**: The SelectionMode when set to `Cell`, lets a user select only a single cell at a time.
*   **CellRange**: The SelectionMode when set to `CellRange`, lets a user select contiguous blocks of cells.
*   **ListBox**: The SelectionMode when set to `ListBox`, lets a user select non-contiguous rows.
*   **None**: The SelectionMode when set to `None`, doesn't allow user to select cells with the mouse or keyboard.
*   **Row**: The SelectionMode when set to `Row`, lets a user select a single row at a time.
*   **RowRange**: The SelectionMode when set to `RowRange`, lets a user select contiguous rows.
*   **MultiRange**: The SelectionMode when set to `MultiRange`, lets a user select multiple ranges by dragging the mouse or pressing Ctrl key along with mouse click.

The following image shows how the FlexGrid appears on setting [SelectionMode](/componentone/api/mvc/online-mvc/dotnet-framework-api/C1.Web.Mvc/C1.Web.Mvc.Grid.SelectionMode.html) to **Row**. The example uses Sale.cs model added in the [QuickStart](/componentone/docs/mvc/online-mvc/workwithcontrols/FlexGrid/FlexGridQuickStart) section.

![](https://cdn.mescius.io/document-site-files/images/2b3ac322-100e-4637-958d-fb40dcda3f44/images/flexgridselectionmode.png)

The following code examples demonstrate how to set the selection mode in FlexGrid.

#### In Code

**SelectionMode.cshtml**

```razor
.SelectionMode(C1.Web.Mvc.Grid.SelectionMode.Row)
```

## See Also

[Quick Start](/componentone/docs/mvc/online-mvc/workwithcontrols/FlexGrid/FlexGridQuickStart)

**Reference**

[Selection Property](/componentone/api/mvc/online-mvc/dotnet-framework-api/C1.Web.Mvc/C1.Web.Mvc.FlexGridBase-1.Selection.html)

[SelectionMode Property](/componentone/api/mvc/online-mvc/dotnet-framework-api/C1.Web.Mvc/C1.Web.Mvc.FlexGridBase-1.SelectionMode.html)

[SelectionMode Enumeration](/componentone/api/mvc/online-mvc/dotnet-framework-api/C1.Web.Mvc/C1.Web.Mvc.Grid.SelectionMode.html)