ToggleButton
Kendo UI ToggleButton component
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Syntax:
public class ToggleButton : WidgetBase, IWidget, IHtmlAttributesContainer, IScriptableComponent
Inheritance: objectWidgetBaseToggleButton
Implements:
Inherited Members
Constructors
Initializes a new instance of the ToggleButton class.
public ToggleButton(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
The view context
initializerIJavaScriptInitializerThe JavaScriptInitializer
urlGeneratorIUrlGeneratorThe 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.
public ToggleButtonBadgeSettings Badge { get; set; }
Sets whether the component should be enabled or disabled.
public bool? Enable { get; set; }
Sets a value controlling how the color is applied.
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.
public string Group { get; set; }
Sets the image url for the and img element inside the component.
public string ImageUrl { get; set; }
Specifies the selected state of the ToggleButtons. If set to true the widget will be initially selected.
public bool? Selected { get; set; }
Sets the size of the component.
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.
public string SpriteCssClass { get; set; }
Specifies the button content.
public HtmlTemplate Template { get; set; }
Sets the color of the component according to the applied theme.
public ThemeColor? ThemeColor { get; set; }
Methods
public override IDictionary<string, object> Serialize()
Overrides:
Writes the HTML.
protected override void WriteHtml(HtmlTextWriter writer)
The HtmlTextWriter.
Overrides:
Writes the initialization script.
public override void WriteInitializationScript(TextWriter writer)
The TextWriter.
Overrides: