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

ToggleButtonBuilder

Properties

WriteAction - Func

Methods

Content(System.Action)

Sets the HTML content of the ToggleButton.

Parameters

content - System.Action

The action which renders the HTML content.

Example


             @(  Html.Kendo().ToggleButton()
                        .Name("toggleButton")
                        .Content(() => { >%
                              <p>Content</p>
                         %<})
                        .Render();
            )

Content(System.Func)

Sets the HTML content of the ToggleButton.

Parameters

content - System.Func<Object,Object>

The Razor template for the HTML content.

Example


             @(Html.Kendo().ToggleButton()
                   .Name("toggleButton")
                   .Content(@<p>Content</p>)
                   .Render();)

Content(System.String)

Sets the HTML content of the Button.

Parameters

content - System.String

The HTML content.

Example


             @( Html.Kendo().ToggleButton()
                     .Name("toggleButton")
                      .Content("<p>Content</p>")
            )

Tag(System.String)

Sets the ToggleButton HTML tag. A button tag is used by default.

Parameters

tag - System.String

The name of the Html element from which the button is initialized.

Example


            @( Html.Kendo().ToggleButton()
                       .Name("Button")
                       .Tag("a")
            )

HtmlAttributes(System.Collections.Generic.IDictionary)

Defines custom attributes of the ToggleButton's element.

Parameters

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

The value for HtmlAttributes

HtmlAttributes(System.Object)

Defines custom attributes of the ToggleButton's element.

Parameters

value - System.Object

The value for HtmlAttributes

Group(System.String)

Specifies a group of ToggleButtons the current instance belongs to. The string will be rendered as a value of the data-group attribute of the widget's element.

Parameters

value - System.String

The value for Group

Selected(System.Boolean)

Specifies the selected state of the ToggleButtons. If set to true the widget will be initially selected.

Parameters

value - System.Boolean

The value for Selected

Selected()

Specifies the selected state of the ToggleButtons. If set to true the widget will be initially selected.

Icon(System.String)

Sets the icon of the component.

Parameters

value - System.String

The value for Icon

IconClass(System.String)

Sets the icon class of the component.

Parameters

value - System.String

The value for IconClass

ImageUrl(System.String)

Sets the image url for the and img element inside the component.

Parameters

value - System.String

The value for ImageUrl

SpriteCssClass(System.String)

Sets the CSS class, which will be used for applying a background image to a span element inside the component.

Parameters

value - System.String

The value for SpriteCssClass

Enable(System.Boolean)

Sets whether the component should be enabled or disabled.

Parameters

value - System.Boolean

The value for Enable

Badge(System.Action)

If set to true a default overlay badge will be displayed. If set to a string, an overlay 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<ToggleButtonBadgeSettingsBuilder>

The configurator for the badge setting.

Size(Kendo.Mvc.UI.ComponentSize)

Sets the size of the component.

Parameters

value - ComponentSize

The value for Size

Rounded(Kendo.Mvc.UI.Rounded)

Sets a value controlling the border radius.

Parameters

value - Rounded

The value for Rounded

FillMode(Kendo.Mvc.UI.FillMode)

Sets a value controlling how the color is applied.

Parameters

value - FillMode

The value for FillMode

ThemeColor(Kendo.Mvc.UI.ThemeColor)

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

Parameters

value - ThemeColor

The value for ThemeColor

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<ToggleButtonEventBuilder>

The client events action.

Example


            @(Html.Kendo().ToggleButton()
                  .Name("ToggleButton")
                  .Events(events => events
                      .Toggle("onToggle")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

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.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

AsChildComponent()

Configures the widget as a child component.

In this article
Not finding the help you need?