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

Switch

Class

Kendo UI Switch component

Definition

Constructors

Initializes a new instance of the Switch class.

C#
public Switch(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

The checked state of the Switch.

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

If set to false, the Switch will be disabled and will not allow the user to change its checked state.

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

Defines the text of the checked and unchecked labels that are displayed within the Switch. All labels support localization.

C#
public SwitchMessagesSettings Messages { get; }

If set to true, the Switch will render into its read-only state.

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; }

The width of the Switch.

C#
public double? Width { get; set; }

Methods

Serializes the component settings to a dictionary.

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

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

Implements: IFormEditor.Serialize()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteHtml(TextWriter)

Writes the initialization script.

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

The TextWriter.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)