GridSelectionSettingsBuilder
Methods
Enabled(System.Boolean)
Enables or disables selection.
Parameters
value - System.Boolean
The boolean parameter for enabling the Selectable functionality.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.Enabled(true))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Mode(Kendo.Mvc.UI.GridSelectionMode)
Specifies whether multiple or single selection is allowed.
Parameters
mode - GridSelectionMode
The mode set for the grid selection.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.Mode(GridSelectionMode.Multiple))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Type(Kendo.Mvc.UI.GridSelectionType)
Specifies whether row or cell selection is allowed.
Parameters
type - GridSelectionType
The type set for the grid selection.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.Type(GridSelectionType.Cell))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
IgnoreOverlapped(System.Boolean)
Specifies whether IgnoreOverlapped is enabled.
Parameters
ignoreOverlapped - System.Boolean
The boolean parameter for the IgnoreOverlapped functionality.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.IgnoreOverlapped(true))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
DragToSelect(System.Boolean)
When set to true, the user can drag to select multiple Grid rows or cells. Applies only for multiple row or cell selection.
Parameters
dragToSelect - System.Boolean
The boolean parameter for DragToSelect funtionality.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.DragToSelect(true).Mode(GridSelectionMode.Multiple))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
CellAggregates(System.Boolean)
If set to true all selection aggregates will be calculated and made available to the Status Bar.
Parameters
value - System.Boolean
The boolean parameter for CellAggregates funtionality.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.CellAggregates(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
CellAggregates(System.Action)
Customize the selection aggregates will be calculated and made available to the Status Bar.
Parameters
configurator - System.Action<GridSelectionAggregatesBuilder>
CheckboxSelection(System.Boolean)
When set to true, the Grid.Selectable will not be initialized. Should be enabled when both checkbox selection for the Grid and cell aggregates are required.
Parameters
value - System.Boolean
The boolean parameter for CheckboxSelection funtionality.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Select();
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Selectable(s => s.CellAggregates(true).CheckboxSelection(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)