By default, FlexGrid allows you to select a range of cells with the mouse or keyboard, similar to Excel. The SelectionMode 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 to:
Cell
, lets a user select only a single cell at a time.CellRange
, lets a user select contiguous blocks of cells.ListBox
, lets a user select non-contiguous rows.None
, doesn't allow user to select cells with the mouse or keyboard.Row
, lets a user select a single row at a time.RowRange
, lets a user select contiguous rows.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 to Row. The example uses Sale.cs model added in the QuickStart section.
The following code examples demonstrate how to set the selection mode in FlexGrid.
SelectionMode.cshtml
Razor |
Copy Code
|
---|---|
.SelectionMode(C1.Web.Mvc.Grid.SelectionMode.Row) |