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

Defines the fluent API for configuring the Kendo Switch for ASP.NET MVC.

Definition

Constructors

Initializes a new instance of the Switch class.

C#
public SwitchBuilder(Switch component)
Parameters:componentSwitch

The component.

Methods

The checked state of the widget.

C#
public SwitchBuilder Checked(bool value)
Parameters:valuebool

The value that configures the checked.

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.Checked(true)
)

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

C#
public SwitchBuilder Enabled(bool value)
Parameters:valuebool

The value that configures the enable.

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.Enabled(true)
)

Configures the client-side events.

C#
public SwitchBuilder Events(Action<SwitchEventBuilder> configurator)
Parameters:configuratorAction<SwitchEventBuilder>

The client events action.

Returns:

SwitchBuilder

Example:
C#
@( Html.Kendo().Switch()
.Name("Switch")
.Events(events =&gt; events
.Change("onChange")
)
)

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

C#
public SwitchBuilder Messages(Action<SwitchMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<SwitchMessagesSettingsBuilder>

The action that configures the messages.

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.Messages(m =&gt; m.Checked("Yes"))
)

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

C#
public SwitchBuilder ReadOnly(bool value)
Parameters:valuebool

The value that configures the readonly.

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.ReadOnly(true)
)

Sets the size of the component.

C#
public SwitchBuilder Size(ComponentSize? value)
Parameters:valueComponentSize?

The value for Size

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.Size(ComponentSize.Large)
)

Sets a value controlling the thumb's border radius.

C#
public SwitchBuilder ThumbRounded(Rounded? value)
Parameters:valueRounded?

The value for ThumbRounded

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.ThumbRounded(Rounded.Medium)
)

Sets a value controlling the track's border radius.

C#
public SwitchBuilder TrackRounded(Rounded? value)
Parameters:valueRounded?

The value for TrackRounded

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.TrackRounded(Rounded.Medium)
)

The width of the Kendo UI Switch.

C#
public SwitchBuilder Width(object value)
Parameters:valueobject

The value that configures the width.

Returns:

SwitchBuilder

Example:
C#
@(Html.Kendo().Switch()
.Name("switch")
.Width(200)
)