All docs
V18.2
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
18.1
17.2

Overview - RadioButtonList

RadioButtonList represents a group of radio button editors that allow you to select one option from several.

Implementation Details

RadioButtonList is realized by the RadioButtonListExtension class. Its instance can be accessed via the ExtensionsFactory.RadioButtonList helper method, which is used to add a RadioButtonList extension to a view. This method's parameter provides access to the RadioButtonList's settings implemented by the RadioButtonListSettings class, allowing you to fully customize the extension.

The RadioButtonList's client counterpart is represented by the ASPxClientRadioButtonList object.

Declaration

RadioButtonList can be added to a view in the following manner.

View code (ASPX):

<% 
    Html.DevExpress().RadioButtonList(
        settings => {
            settings.Name = "radioButtonList1";

            settings.Properties.Items.Add("Yes, this time only");
            settings.Properties.Items.Add("No, not this time");
            settings.Properties.Items.Add("Yes, always");
            settings.Properties.Items.Add("No, never");

            settings.SelectedIndex = 1;
        }
    )
    .Render();
%>  

View code (Razor):

@Html.DevExpress().RadioButtonList(
    settings => {
        settings.Name = "radioButtonList1";

        settings.Properties.Items.Add("Yes, this time only");
        settings.Properties.Items.Add("No, not this time");
        settings.Properties.Items.Add("Yes, always");
        settings.Properties.Items.Add("No, never");

        settings.SelectedIndex = 1;
    }).GetHtml()
NOTE

The Partial View should contain only the extension's code.

The code result is demonstrated in the image below.

radiobuttonlist-declaration.png

See Also