Skip to main content
Tab

ASPxRadioButton Class

Represents a radio button control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public class ASPxRadioButton :
    ASPxCheckBox

Remarks

The ASPxRadioButton class represents a button that can be selected, but not cleared, by a user: An ASPxRadioButton control being paired with other radio button controls enables end-users to select a single option from a group of choices. The buttons are grouped logically if they all share the same ASPxRadioButton.GroupName property. The ASPxRadioButton control permits you to intersperse the radio buttons in a group with other content in the page.

The ASPxRadioButton control consists of the edit region (radio button) and the text label:

ASPxRadioButton_control.png

Create a Radio Button

Design Time

The ASPxRadioButton control is available on the DX.24.2: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

<dx:ASPxRadioButton ID="radioButton" runat="server" Text="Send me notification emails" Checked="true" />

Run Time

using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
    ASPxRadioButton radioButton = new ASPxRadioButton();
    radioButton.ID = "radioButton";
    Page.Form.Controls.Add(radioButton);

    radioButton.Text = "Send me notification emails";
    radioButton.Checked = true;
}

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

The control’s text label can be defined via the ASPxCheckBox.Text property. The text label’s alignment relative to the radio button is specified via the ASPxCheckBox.TextAlign property. The ASPxCheckBox.Layout property can be used to control whether the radio button and the text label are displayed in a table or using flow layout.

The state of the radio button control can be specified using the ASPxCheckBox.Checked (via the ASPxRadioButton.Checked) property. A change to the control’s state forces the ASPxCheckBox.CheckedChanged (via the ASPxRadioButton.CheckedChanged) event to fire.

Note

The client-side equivalent of this editor control is represented by the ASPxClientRadioButton object. The editor’s client-side API is enabled if the ASPxEditBase.EnableClientSideAPI property is set to true, or any client event is handled. Available client events can be accessed via the ASPxCheckBox.ClientSideEvents property.

See Also