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

Defines the fluent API for configuring the Kendo ButtonGroup for ASP.NET MVC.

Definition

Constructors

Initializes a new instance of the ButtonGroup class.

C#
public ButtonGroupBuilder(ButtonGroup component)
Parameters:componentButtonGroup

The component.

Methods

BindTo method of the ButtonGroup

C#
public ButtonGroupBuilder BindTo(IEnumerable<ButtonGroupItem> items)
Parameters:itemsIEnumerable<ButtonGroupItem>

The action that configures the items.

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.BindTo(new List&lt;ButtonGroupItem&gt;()
{
new ButtonGroupItem(){ Text = "First item"},
new ButtonGroupItem(){ Text = "Second item"}
})
)

Defines if the widget is initially enabled or disabled.

C#
public ButtonGroupBuilder Enable(bool value)
Parameters:valuebool

The value that configures the enable.

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.Enable(false)
)

Configures the client-side events.

C#
public ButtonGroupBuilder Events(Action<ButtonGroupEventBuilder> configurator)
Parameters:configuratorAction<ButtonGroupEventBuilder>

The client events action.

Returns:

ButtonGroupBuilder

Example:
C#
@( Html.Kendo().ButtonGroup()
.Name("ButtonGroup")
.Events(events =&gt; events
.Select("onSelect")
)
)

Sets a value controlling how the color is applied.

C#
public ButtonGroupBuilder FillMode(ButtonFillMode? value)
Parameters:valueButtonFillMode?

The value that configures the fillMode

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.FillMode(ButtonFillMode.Solid)

Defines the initially selected Button (zero based index).

C#
public ButtonGroupBuilder Index(int value)
Parameters:valueint

The value that configures the index.

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.Index(1)
)

Contains the items of the button group widget

C#
public ButtonGroupBuilder Items(Action<ButtonGroupItemFactory> configurator)
Parameters:configuratorAction<ButtonGroupItemFactory>

The action that configures the items.

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.Items(t =&gt;
{
t.Add().Text("Month");
t.Add().Text("Quarter");
t.Add().Text("Year");
})
)

Sets a value controlling the border radius.

C#
public ButtonGroupBuilder Rounded(Rounded? value)
Parameters:valueRounded?

The value that configures the rounded

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.Rounded(Rounded.Small)

Accepts "multiple" and "single".By default, single selection is enabled.

C#
public ButtonGroupBuilder Selection(string value)
Parameters:valuestring

The value that configures the selecton.

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.Selection("multiple")
)

Sets the size of the component.

C#
public ButtonGroupBuilder Size(ComponentSize? value)
Parameters:valueComponentSize?

The value that configures the size

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.Size(ComponentSize.Small)

Sets the color of the component according to the applied theme.

C#
public ButtonGroupBuilder ThemeColor(ThemeColor? value)
Parameters:valueThemeColor?

The value that configures the themeColor

Returns:

ButtonGroupBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("button-group")
.ThemeColor(ThemeColor.Primary)