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

Defines the fluent API for configuring the ButtonGroupItem settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ButtonGroupItemBuilder

Inheritance: objectButtonGroupItemBuilder

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

Constructors

C#
public ButtonGroupItemBuilder(ButtonGroupItem settings)
Parameters:settingsButtonGroupItem

Methods

If set to true a default overlay badge will be displayed. If set to a string, an ovelay with content set to the specified string will be displayed. Can be set to a JavaScript object which represents the configuration of the Badge widget.

C#
public ButtonGroupItemBuilder Badge(Action<ButtonGroupItemBadgeBuilder> configurator)
Parameters:configuratorAction<ButtonGroupItemBadgeBuilder>

The configurator for the badge setting.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Badge(b =&gt; b.Max(100));
})
)

If set to true a default overlay badge will be displayed. If set to a string, an ovelay with content set to the specified string will be displayed. Can be set to a JavaScript object which represents the configuration of the Badge widget.

C#
public ButtonGroupItemBuilder Badge(bool enabled)
Parameters:enabledbool

Enables or disables the badge option.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Badge(true);
})
)

If set to true a default overlay badge will be displayed. If set to a string, an ovelay with content set to the specified string will be displayed. Can be set to a JavaScript object which represents the configuration of the Badge widget.

C#
public ButtonGroupItemBuilder Badge(string value)
Parameters:valuestring

The value of the badge.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Badge("test");
})
)

Enables or disables the item. Disabled item cannot be clicked.

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

The boolean value that configures the Enabled configuration.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Enabled(true);
})
)

Specifies if text field of the ButtonGroup item should be encoded.

C#
public ButtonGroupItemBuilder Encoded(bool value)
Parameters:valuebool

The value that configures whether text should be encoded.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Encoded(false);
})
)

Sets the HTML attributes.

C#
public virtual ButtonGroupItemBuilder HtmlAttributes(IDictionary<string, object> attributes)
Parameters:attributesIDictionary<string, object>

The HTML attributes.

Returns:

ButtonGroupItemBuilder

Sets the HTML attributes.

C#
public virtual ButtonGroupItemBuilder HtmlAttributes(object attributes)
Parameters:attributesobject

The HTML attributes.

Returns:

ButtonGroupItemBuilder

Defines the name of an existing icon in a Kendo theme.

C#
public ButtonGroupItemBuilder Icon(string value)
Parameters:valuestring

The value that configures the icon.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Icon("align-center");
})
)

Allows the usage of custom icons. Defines CSS classes which are to be applied to a span element inside the ButtonGroup item

C#
public ButtonGroupItemBuilder IconClass(string value)
Parameters:valuestring

The value that configures the custom icon.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").IconClass("fa fa-male");
})
)

Selects or unselects the item. By default items are not selected.

C#
public ButtonGroupItemBuilder Selected(bool value)
Parameters:valuebool

The boolean value that configures the Selected configuration.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Selected(true);
})
)

Specifies the text of the item

C#
public ButtonGroupItemBuilder Text(string value)
Parameters:valuestring

The value that configures the text.

Returns:

ButtonGroupItemBuilder

Example:
C#
@(Html.Kendo().ButtonGroup()
.Name("select-period")
.Items(t =&gt;
{
t.Add().Text("Month").Text("test");
})
)