RadToggleButton
RadToggleButton provides toggle functionality to a button, allowing the user to configure different states toggled on each button press or by provided API.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[TelerikToolboxCategory("Navigation")]
[ToolboxBitmap(typeof(RadToggleButton), "Toolbox.Icons.Button.png")]
[RequiredScript(typeof(jQueryPlugins))]
[RequiredScript(typeof(PostBackButtonBase))]
[ClientScriptResource("Telerik.Web.UI.RadToggleButton", "Telerik.Web.UI.Button.RadButtonScripts.js")]
[EmbeddedSkin("Button")]
[EmbeddedSkin("Button", "Default")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Classic, typeof(RadButton))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadButton))]
public class RadToggleButton : PostBackButtonBase, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, INamingContainer, IButtonControl, IPostBackEventHandler
Inheritance: objectControlWebControlRadWebControlRadButtonBasePostBackButtonBaseRadToggleButton...
Implements:
Inherited Members
Constructors
public RadToggleButton()
Properties
Gets the object that controls the built-in confirmation dialog properties.
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonConfirmSettings ConfirmSettings { get; }
Gets or sets the name of the JavaScript function that will be called after the SelectedToggleStateIndex property of the RadToggleButton control is changed.
[ClientControlEvent]
[ClientPropertyName("toggleStateChanged")]
public string OnClientToggleStateChanged { get; set; }
Gets or sets the name of the JavaScript function that will be called when the SelectedToggleStateIndex property of the RadToggleButton control is about to be changed.
[ClientControlEvent]
[ClientPropertyName("toggleStateChanging")]
public string OnClientToggleStateChanging { get; set; }
Gets the currently selected ToggleState of the RadToggleButton control.
[Browsable(false)]
[Bindable(false)]
[Themeable(false)]
public virtual ButtonToggleState SelectedToggleState { get; }
Gets or sets the index of the currently selected ToggleState of the RadToggleButton control.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("selectedToggleStateIndex")]
public virtual int SelectedToggleStateIndex { get; set; }
Gets a collection of ButtonToggleState objects that belong to the RadToggleButton control.
[Themeable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ButtonToggleStateCollection ToggleStates { get; }
Methods
Clears out the list selection and sets the Selected property of all ToggleState objects to false.
public virtual void ClearSelection()
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
Find a RadToggleButton's ToggleState by the value of its Text property
public virtual ButtonToggleState FindToggleStateByText(string text)
Text of the ToggleState
Returns:Find a RadToggleButton's ToggleState by the value of its Value property
public virtual ButtonToggleState FindToggleStateByValue(string value)
Value of the ToggleState
Returns:public virtual IEnumerable<JavaScriptConverter> GetJsConverters()
Raises the ToggleStateChaned event of the RadButton control.
protected virtual void OnToggleStateChanged(ToggleButtonStateChangedEventArgs e)
Invokes the OnToggleStateChanged methods, when the SelectedToggleStateIndex property of the control has changed.
protected override void RaisePostDataChangedEvent()
Overrides:
Sets the selected state by provided value.
If multiple ToggleStates have equal value the first one will be selected.
If ToggleState with the provided value is not registered the current ToggleState will not be changed.
public virtual void SetSelectedToggleStateByText(string text)
Text of the ToggleState to be selected
Sets the selected state by provided value.
If multiple ToggleStates have equal value the first one will be selected.
If ToggleState with the provided value is not registered the current ToggleState will not be changed.
public virtual void SetSelectedToggleStateByValue(string value)
Value of the ToggleState to be selected
Events
Adds or removes an event handler method from the ToggleStateChanged event.
The event is fired when the value of the SelectedToggleStateIndex property changes between posts to the server.
public event ToggleButtonStateChangedEventHandler ToggleStateChanged