New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Switch Object

The following table lists the most important members of the client-side RadSwitch object:

Public Properties

NameDescription
get_checkedReturns a bool value, indicating whether the switch is checked.
set_checkedSets a nullable boolean value that indicates whether the switch is checked. When a null value is set, the value will default to false.
get_enabledReturns a value, indicating whether the switch control is enabled.
set_enabledSets whether the switch is enabled.
get_toolTipGets the text displayed when the mouse pointer hovers over the RadSwitch control.
set_toolTipSets the text displayed when the mouse pointer hovers over the RadSwitch control.
get_uniqueIDGets the unique, hierarchically qualified identifier for the RadSwitch control.
get_textElementGets a reference to the HTML element that holds the text of the RadSwitch control.
get_cssClassGets the Cascading Style Sheet (CSS) class rendered by the RadSwitch control on the client.
get_disabledCssClassGets the CSS class applied when the control is disabled.
get_hoveredCssClassGets the CSS class applied to the RadSwitch control when the mouse pointer is over the control.
get_pressedCssClassGets the CSS class applied to the RadSwitch control when the control is pressed.
get_commandNameGets the command name associated with the RadSwitch control that is passed to the Command event.
set_commandNameSets the command name associated with the RadSwitch control that is passed to the Command event.
get_commandArgumentGets an optional parameter passed to the Command event along with the associated CommandName.
set_commandArgumentSets an optional parameter passed to the Command event along with the associated CommandName.
get_autoPostBackGets a bool value indicating whether the RadSwitch control automatically posts back to the server when clicked.
set_autoPostBackSets a bool value indicating whether the RadSwitch control automatically posts back to the server when clicked.
get_heightGets the height of the RadSwitch control.
get_widthGets the width of the RadSwitch control.
get_visibleGets a bool value indicating whether the switch is visible.
set_visibleShows/hides the switch.
get_validationGroupGets the name of ValidationGroup to which RadSwitch is assigned.
set_validationGroupSets the validation group to which RadSwitch should be assigned.

Public Methods

NameDescription
focusBrings the focus to the RadSwitch control.
clickExecutes programmatic switch click. Accepts an optional boolean parameter that specifies whether the client-side clicking event of RadSwitch will be fired when the control is clicked programmatically. If the function is called without parameter, the clicking event will not be fired.

Methods for Modifying Client-side Event Handlers Dynamically

NameDescription
add_loadThe name of the JavaScript function called when the control loads.
remove_loadRemoves a handler for the load event.
add_clickingThe name of the JavaScript function called when the RadSwitch control is clicked.
remove_clickingRemoves a handler for the clicking event.
add_checkedChangingThe name of the JavaScript function called before the checked state of the switch is changed.
remove_checkedChangingRemoves a handler for the checkedChanging event.
add_checkedChangedThe name of the JavaScript function called when the checked state of the switch is changed.
remove_checkedChangedRemoves a handler for the checkedChanged event.
add_clickedThe name of the JavaScript function called when the RadSwitch control is clicked.
remove_clickedRemoves a handler for the clicked event.
add_mouseOverThe name of the JavaScript function called when the mouse hovers over the control.
remove_mouseOverRemoves a handler for the mouseOver event.
add_mouseOutThe name of the JavaScript function when the mouse leaves the control.
remove_mouseOutRemoves a handler for the mouseOut event.

You can read more on the subject in the Setting Client Event Handlers by Using JavaScript help article.

See Also

In this article
See Also
Not finding the help you need?
Contact Support