By default, the selection functionality of the Telerik UI Grid for ASP.NET Core is disabled.
To control the selection in the Grid, use the
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>() .Name("rowSelection") .Selectable(selectable => selectable .Mode(GridSelectionMode.Multiple)) ...
The Grid supports the following select modes:
You can set the select mode to
Single. Additionally, the Grid provides the
Cell select types which allow multiple or single selection of rows or cells.
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>() .Name("cellSelection") .Selectable(selectable => selectable .Mode(GridSelectionMode.Multiple) .Type(GridSelectionType.Cell)) ...
The Grid also provides a built-in functionality for persisting the selection through the
PersistSelection property and its setting it to
true. You also need to configure the
ID field in the schema of the DataSource. For a runnable example, refer to the demo on persisting the state of the Grid.
.PersistSelection(true) .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.OrderID))