RadButton
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[RequiredScript(typeof(jQueryPlugins))]
[RequiredScript(typeof(MaterialRipple))]
[ClientScriptResource("Telerik.Web.UI.RadButton", "Telerik.Web.UI.Button.RadButtonScripts.js")]
[EmbeddedSkin("Button")]
[EmbeddedSkin("Button", "Default")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadButton))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
[TelerikToolboxCategory("Navigation")]
[ToolboxBitmap(typeof(RadButton), "Toolbox.Icons.Button.png")]
public class RadButton : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IButtonControl, IPostBackEventHandler, ICheckBoxControl, INamingContainer
Inheritance: objectControlWebControlRadWebControlRadButton
Implements:
Inherited Members
Constructors
public RadButton()
Properties
Gets or sets the accessKey of the RadButton control.
public override string AccessKey { get; set; }
Overrides:
Gets or sets a bool value indicating whether the RadButton control automatically posts back to the server when clicked.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("autoPostBack")]
public virtual bool AutoPostBack { get; set; }
Gets or sets the type of the button. RadButtonType:StandardButton(default), LinkButton and ToggleButton.
[Themeable(false)]
[ClientControlProperty]
public virtual RadButtonType ButtonType { get; set; }
Gets or sets a value indicating whether validation is performed when the RadButton control is clicked.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("_causesValidation")]
public virtual bool CausesValidation { get; set; }
Implements:
Gets or sets a bool value indicating whether the RadButton control is checked.
[Bindable(true, BindingDirection.TwoWay)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("checked")]
public virtual bool Checked { get; set; }
Implements:
Gets or sets an optional parameter passed to the Command event along with the associated CommandName.
[Bindable(true)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("commandArgument")]
public string CommandArgument { get; set; }
Implements:
Gets or sets the command name associated with the RadButton control that is passed to the Command event.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("commandName")]
public string CommandName { get; set; }
Implements:
Gets the object that controls the built-in confirmation dialog properties.
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonConfirmSettings ConfirmSettings { get; }
Gets or sets the template for the RadButton control.
[TemplateContainer(typeof(RadButton))]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate ContentTemplate { get; set; }
An object implementing the ITemplate interface. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.
Gets or sets the CSS class rendered by the RadButton control on the client.
[ClientControlProperty]
[ClientPropertyName("cssClass")]
public override string CssClass { get; set; }
Overrides:
Gets or sets the CSS class applied to the RadButton control when it is in a disabled state.
[ClientControlProperty]
[ClientPropertyName("disabledCssClass")]
public virtual string DisabledButtonCssClass { get; set; }
When set to true enables support for WAI-ARIA
[ClientControlProperty]
[ClientPropertyName("enableAriaSupport")]
public bool EnableAriaSupport { get; set; }
Gets or sets a bool value indicating whether the client browser's default styling will be applied to the RadButton control.
When this property is set to true, the control will look like standard HTML input of type="button" or type="submit", with the default styles applied by the client browser.
public virtual bool EnableBrowserButtonStyle { get; set; }
Gets or sets a bool value indicating whether an additional button (besides the primary button) will be rendered in the RadButton control.
[ClientControlProperty]
[ClientPropertyName("enableSplitButton")]
public virtual bool EnableSplitButton { get; set; }
Gets or sets the name of the group the RadButton control, configured as a radio button (ToggleType='Radio'), belongs to.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("groupName")]
public virtual string GroupName { get; set; }
Gets or sets the height of the RadButton control.
[ClientControlProperty]
[ClientPropertyName("height")]
public override Unit Height { get; set; }
Overrides:
Gets or sets the CSS class applied to the RadButton control when the mouse pointer is over the control.
[ClientControlProperty]
[ClientPropertyName("hoveredCssClass")]
public virtual string HoveredCssClass { get; set; }
Gets the object that controls the Primary and Secondary Icon related properties.
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonIcon Icon { get; }
Gets the object that control the Image properties. A RadButton control can be rendered as an ImageButton, or it can have a BackgroundImage.
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonImage Image { get; }
Gets or sets the URL to link to when the RadButton control is clicked.
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("_navigateUrl")]
public string NavigateUrl { get; set; }
Gets or sets the name of the JavaScript function that will be called after the Checked property of the RadButton control is changed.
[ClientControlEvent]
[ClientPropertyName("checkedChanged")]
public string OnClientCheckedChanged { get; set; }
Gets or sets the name of the JavaScript function that will be called when the Checked property of the RadButton control is about to be changed.
[ClientControlEvent]
[ClientPropertyName("checkedChanging")]
public string OnClientCheckedChanging { get; set; }
Gets or sets the name of the JavaScript function that will be called when the RadButton is clicked, after the OnClientClicking event.
[ClientControlEvent]
[ClientPropertyName("clicked")]
public string OnClientClicked { get; set; }
Gets or sets the name of the JavaScript function that will be called when the RadButton is clicked. The event is cancelable.
[ClientControlEvent]
[ClientPropertyName("clicking")]
public string OnClientClicking { get; set; }
Gets or sets the name of the JavaScript function that will be called when the RadButton is loaded on the page.
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }
Gets or sets the name of the JavaScript function that will be called when the mouse pointer leaves the RadButton.
[ClientControlEvent]
[ClientPropertyName("mouseOut")]
public string OnClientMouseOut { get; set; }
Gets or sets the name of the JavaScript function that will be called when the mouse pointer hovers over the RadButton.
[ClientControlEvent]
[ClientPropertyName("mouseOver")]
public string OnClientMouseOver { get; set; }
Gets or sets the name of the JavaScript function that will be called after the SelectedToggleStateIndex property of the RadButton 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 RadButton control is about to be changed.
[ClientControlEvent]
[ClientPropertyName("toggleStateChanging")]
public string OnClientToggleStateChanging { get; set; }
Gets or sets the URL of the page to post to from the current page when the RadButton control is clicked.
[Themeable(false)]
public string PostBackUrl { get; set; }
Implements:
Gets or sets the CSS class applied to the RadButton control when the control is pressed.
[ClientControlProperty]
[ClientPropertyName("pressedCssClass")]
public virtual string PressedCssClass { get; set; }
Gets/Sets the primary appearance of the button.
[ClientControlProperty]
[ClientPropertyName("primary")]
public bool Primary { get; set; }
Gets or sets a bool value indicating whether the RadButton control is in a read-only mode.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("readOnly")]
public bool ReadOnly { get; set; }
Gets or sets the CSS class applied to the RadButton control when it is in ReadOnly mode. The ReadOnly property is set to true.
[ClientControlProperty]
[ClientPropertyName("readOnlyCssClass")]
public virtual string ReadOnlyCssClass { get; set; }
Gets the currently selected ToggleState of the RadButton control when used as a custom toggle button.
[Browsable(false)]
[Bindable(false)]
[Themeable(false)]
public virtual RadButtonToggleState SelectedToggleState { get; }
Gets or sets the index of the currently selected ToggleState of the RadButton control, when used as a custom toggle button.
[Browsable(false)]
[Bindable(false)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("selectedToggleStateIndex")]
public virtual int SelectedToggleStateIndex { get; set; }
Gets or sets a bool value indicating whether the RadButton control will be immediately disabled after the user has clicks it. (i.e. enables/disables "Single Click" functionality)
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("singleClick")]
public virtual bool SingleClick { get; set; }
Gets or sets the text displayed in the RadButton control after the button is being clicked and disabled. (i.e. the text used for the 'Single Click' functionality)
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("singleClickText")]
public string SingleClickText { get; set; }
Gets or sets the CSS class applied to the SplitButton of the RadButton control.
public virtual string SplitButtonCssClass { get; set; }
Gets or sets the position (relative to the RadButton's text) of the split button.
public virtual ButtonPosition SplitButtonPosition { get; set; }
Gets or sets the target window or frame in which to display the Web page content linked to when the RadButton control is clicked.
[TypeConverter(typeof(TargetConverter))]
[ClientControlProperty]
[ClientPropertyName("target")]
public string Target { get; set; }
Gets or sets the text displayed in the RadButton control.
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("text")]
public string Text { get; set; }
Implements:
Gets a collection of RadButtonToggleState objects that belong to the RadButton control.
[Themeable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonToggleStateCollection ToggleStates { get; }
Gets or sets the toggle type of the RadButton control when used as a toggle button. The Default is ButtonToggleType='None'.
[Themeable(false)]
[ClientControlProperty]
public virtual ButtonToggleType ToggleType { get; set; }
Gets or sets the text that will be displayed in the tooltip of the RadButton control when it is hovered.
[ClientControlProperty]
[ClientPropertyName("toolTip")]
public override string ToolTip { get; set; }
Overrides:
Gets or sets a value indicating whether the RadButton control uses the client browser's submit mechanism or the ASP.NET postback mechanism.
[Themeable(false)]
public virtual bool UseSubmitBehavior { get; set; }
Gets or sets the group of controls for which the RadButton control causes validation when it posts back to the server.
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("_validationGroup")]
public virtual string ValidationGroup { get; set; }
Implements:
Gets or sets an optional Value of the RadButton control.
[ClientControlProperty]
[ClientPropertyName("value")]
public string Value { get; set; }
Methods
Adds the attributes of the RadButton control to the output stream for rendering on the client.
protected override void AddAttributesToRender(HtmlTextWriter writer)
An HtmlTextWriter that contains the output stream to render on the client.
Overrides:
Clears out the list selection and sets the Selected property of all ToggleState objects to false.
public virtual void ClearSelection()
Find a RadButton's ToggleState by the value of its Text property
public virtual RadButtonToggleState FindToggleStateByText(string text)
Text of the ToggleState
Returns:Find a RadButton's ToggleState by the value of its Value property
public virtual RadButtonToggleState FindToggleStateByValue(string value)
Value of the ToggleState
Returns:Creates a PostBackOptions object that represents the RadButton control's postback behavior, and returns the client script generated as a result of the PostBackOptions.
protected virtual string GetPostbackEventReference()
The client script that represents the RadButton control's PostBackOptions.
Raises the CheckedChanged event of the RadButton control.
Raises the Click event of the RadButton control.
protected virtual void OnClick(ButtonClickEventArgs e)
A ButtonClickEventArgs that contains the event data.
Raises the Command event of the RadButton control.
protected virtual void OnCommand(ButtonCommandEventArgs e)
A ButtonCommandEventArgs that contains the event data.
Raises the ToggleStateChaned event of the RadButton control.
protected virtual void OnToggleStateChanged(ButtonToggleStateChangedEventArgs e)
Raises events for the RadButton control when it posts back to the server.
protected virtual void RaisePostBackEvent(string eventArgument)
The argument for the event.
Invokes the OnCheckedChanged and OnToggleStateChanged methods, when the Checked and SelectedToggleStateIndex properties of the RadButton control have 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 CheckedChanged event. The event is fired when the value of the Checked property changes between posts to the server.
public event EventHandler CheckedChanged
Implements:
Adds or removes an event handler method from the Click event. The event is fired when the RadButton control is clicked.
public event EventHandler Click
Implements:
Adds or removes an event handler method from the Command event. The event is fired when the RadButton control is clicked.
public event CommandEventHandler Command
Implements:
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 ButtonToggleStateChangedEventHandler ToggleStateChanged