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

Defines the fluent API for configuring ButtonGroupItem

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

ButtonGroupItemBuilder method.

C#
public ButtonGroupItemBuilder(ButtonGroupItem container)
Parameters:containerButtonGroupItem

Properties

Gets the settings being configured.

C#
protected ButtonGroupItem Container { get; }

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<ButtonGroupItemBadgeSettingsBuilder> configurator)
Parameters:configuratorAction<ButtonGroupItemBadgeSettingsBuilder>

The ButtonGroupItemBadgeSettingsBuilder for the badge setting.

Returns:

ButtonGroupItemBuilder

Returns the current instance of ButtonGroupItemBuilder .

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

Returns the current instance of ButtonGroupItemBadgeSettingsBuilder .

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

Sets the value of the badge.

Returns:

ButtonGroupItemBuilder

Specifies if a button is enabled.

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

The value for Enabled

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

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 for Encoded

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

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

Defines the name of an existing icon in a Kendo theme that is rendered after the text of the item.

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

The value for EndIcon

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

Specifies the HTML attributes of a ButtonGroup item.

C#
public ButtonGroupItemBuilder HtmlAttributes(IDictionary<string, object> value)
Parameters:valueIDictionary<string, object>

The value for HtmlAttributes

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

Specifies the HTML attributes of a ButtonGroup item.

C#
public ButtonGroupItemBuilder HtmlAttributes(object value)
Parameters:valueobject

The value for HtmlAttributes

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

Defines the name of an existing icon in a Kendo theme.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

C#
public ButtonGroupItemBuilder Icon(Action<ButtonGroupItemIconSettingsBuilder> configurator)
Parameters:configuratorAction<ButtonGroupItemIconSettingsBuilder>

The ButtonGroupItemIconSettingsBuilder for the icon setting.

Returns:

ButtonGroupItemBuilder

Returns the current instance of ButtonGroupItemBuilder .

Defines the name of an existing icon in a Kendo theme.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

C#
public ButtonGroupItemBuilder Icon(string icon)
Parameters:iconstring

The icon.

Returns:

ButtonGroupItemBuilder

Returns the current instance of ButtonGroupItemBuilder .

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 for IconClass

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

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

If set, the ButtonGroup will render an image with the specified URL in the button.

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

The value for ImageUrl

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

Specifies if a button is initially selected.

C#
public ButtonGroupItemBuilder Selected()
Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

Specifies if a button is initially selected.

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

The value for Selected

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

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

Specifies the text of the ButtonGroup item.

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

The value for Text

Returns:

ButtonGroupItemBuilder

Returns the current ButtonGroupItemBuilder instance.

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