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

Kendo UI ToggleButton component

Definition

Constructors

Initializes a new instance of the ToggleButton class.

C#
public ToggleButton(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
Parameters:viewContextViewContext

The view context

initializerIJavaScriptInitializer

The JavaScriptInitializer

urlGeneratorIUrlGenerator

The URL generator.

Properties

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.

C#
public ToggleButtonBadgeSettings Badge { get; set; }

Sets whether the component should be enabled or disabled.

C#
public bool? Enable { get; set; }

Sets a value controlling how the color is applied.

C#
public FillMode? FillMode { get; set; }

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.

C#
public string Group { get; set; }

Sets the icon of the component.

C#
public string Icon { get; set; }

Sets the icon class of the component.

C#
public string IconClass { get; set; }

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

C#
public string ImageUrl { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }

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

C#
public bool? Selected { get; set; }

Sets the size of the component.

C#
public ButtonSize? Size { get; set; }

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

C#
public string SpriteCssClass { get; set; }

Specifies the ToggleButton HTML tag.

C#
public string Tag { get; set; }

Specifies the button content.

C#
public HtmlTemplate Template { get; set; }

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

C#
public ThemeColor? ThemeColor { get; set; }

Methods

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: WidgetBase.Serialize()

Writes the HTML.

C#
protected override void WriteHtml(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

The HtmlTextWriter.

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The TextWriter.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)