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

Switch

Class

Definition

Constructors

C#
public Switch(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
Parameters:viewContextViewContextinitializerIJavaScriptInitializerurlGeneratorIUrlGenerator

Properties

C#
public bool Checked { get; set; }
C#
public bool Enabled { get; set; }

Defines the text of the checked and unchecked labels that are shown within the Switch. All labels could be localized.

C#
public SwitchMessagesSettings Messages { get; set; }
C#
public bool ReadOnly { get; set; }

Sets the size of the component.

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

Sets a value controlling the thumb's border radius.

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

Sets a value controlling the track's border radius.

C#
public Rounded? TrackRounded { get; set; }
C#
public bool Value { get; set; }
C#
public object Width { get; set; }

Methods

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

IDictionary<string, object>

Overrides: WidgetBase.Serialize()

Implements: IFormEditor.Serialize()

Writes the HTML.

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

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

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

The writer.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)