New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent interface for configuring Selectable

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class GridSelectionSettingsBuilder

Inheritance: objectGridSelectionSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public GridSelectionSettingsBuilder(GridSelectableSettings settings)
Parameters:settingsGridSelectableSettings

Methods

Customize the selection aggregates will be calculated and made available to the Status Bar.

C#
public GridSelectionSettingsBuilder CellAggregates(Action<GridSelectionAggregatesBuilder> configurator)
Parameters:configuratorAction<GridSelectionAggregatesBuilder>Returns:

GridSelectionSettingsBuilder

If set to true all selection aggregates will be calculated and made available to the Status Bar.

C#
public GridSelectionSettingsBuilder CellAggregates(bool value)
Parameters:valuebool

The boolean parameter for CellAggregates funtionality.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.CellAggregates(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

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.

C#
public GridSelectionSettingsBuilder CheckboxSelection(bool value)
Parameters:valuebool

The boolean parameter for CheckboxSelection funtionality.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Select();
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.CellAggregates(true).CheckboxSelection(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

When set to true, the user can drag to select multiple Grid rows or cells. Applies only for multiple row or cell selection.

C#
public GridSelectionSettingsBuilder DragToSelect(bool dragToSelect)
Parameters:dragToSelectbool

The boolean parameter for DragToSelect funtionality.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.DragToSelect(true).Mode(GridSelectionMode.Multiple))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

Enables or disables selection.

C#
public GridSelectionSettingsBuilder Enabled(bool value)
Parameters:valuebool

The boolean parameter for enabling the Selectable functionality.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.Enabled(true))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

Specifies whether IgnoreOverlapped is enabled.

C#
public GridSelectionSettingsBuilder IgnoreOverlapped(bool ignoreOverlapped)
Parameters:ignoreOverlappedbool

The boolean parameter for the IgnoreOverlapped functionality.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.IgnoreOverlapped(true))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

Specifies whether multiple or single selection is allowed.

C#
public GridSelectionSettingsBuilder Mode(GridSelectionMode mode)
Parameters:modeGridSelectionMode

The mode set for the grid selection.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.Mode(GridSelectionMode.Multiple))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

Specifies whether row or cell selection is allowed.

C#
public GridSelectionSettingsBuilder Type(GridSelectionType type)
Parameters:typeGridSelectionType

The type set for the grid selection.

Returns:

GridSelectionSettingsBuilder

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Selectable(s =&gt; s.Type(GridSelectionType.Cell))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)