ButtonGroupItemBuilder

Methods

Icon(System.String)

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

Parameters

value - System.String

The value that configures the icon.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Icon("align-center");
                   })
            )
             

IconClass(System.String)

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

Parameters

value - System.String

The value that configures the custom icon.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").IconClass("fa fa-male");
                   })
            )
             

Encoded(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures whether text should be encoded.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Encoded(false);
                   })
            )
             

Text(System.String)

Specifies the text of the item

Parameters

value - System.String

The value that configures the text.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Text("test");
                   })
            )
             

Selected(System.Boolean)

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

Parameters

value - System.Boolean

The boolean value that configures the Selected configuration.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Selected(true);
                   })
            )
             

Enabled(System.Boolean)

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

Parameters

value - System.Boolean

The boolean value that configures the Enabled configuration.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Enabled(true);
                   })
            )
             

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

Badge(System.Action)

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.

Parameters

configurator - System.Action<ButtonGroupItemBadgeBuilder>

The configurator for the badge setting.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Badge(b => b.Max(100));
                   })
            )
             

Badge(System.Boolean)

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.

Parameters

enabled - System.Boolean

Enables or disables the badge option.

Example

Razor
 
            @(Html.Kendo().ButtonGroup()
                   .Name("select-period")
                   .Items(t =>
                   {
                       t.Add().Text("Month").Badge(true);
                   })
            )
             

Badge(System.String)

Parameters

value - System.String