Class RadzenRadioButtonList<TValue>
A radio button group component that allows users to select a single option from a list of choices. RadzenRadioButtonList displays multiple radio buttons with configurable layout, orientation, and data binding. Presents mutually exclusive options where only one can be selected at a time. Supports data binding via Data property or static item declaration, configurable layout including orientation (Horizontal/Vertical), gap spacing, wrapping, alignment, and justification, custom item templates for complex radio button content, disabled items individually or for the entire list, and keyboard navigation (Arrow keys, Space, Enter) for accessibility. Use for forms where users must choose one option from several, like payment methods, shipping options, or preference settings.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenRadioButtonList<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
Type Parameters
| Name | Description |
|---|---|
| TValue | The type of the selected value. Each radio button option has a value of this type. |
Examples
Static radio button list:
<RadzenRadioButtonList @bind-Value=@selectedOption TValue="string" Orientation="Orientation.Vertical">
<Items>
<RadzenRadioButtonListItem Text="Option 1" Value="option1" />
<RadzenRadioButtonListItem Text="Option 2" Value="option2" />
<RadzenRadioButtonListItem Text="Option 3" Value="option3" />
</Items>
</RadzenRadioButtonList>
Data-bound radio list with disabled item:
<RadzenRadioButtonList @bind-Value=@paymentMethod TValue="int" Data=@paymentMethods
TextProperty="Name" ValueProperty="Id" DisabledProperty="IsDisabled" />
Constructors
RadzenRadioButtonList()
A radio button group component that allows users to select a single option from a list of choices. RadzenRadioButtonList displays multiple radio buttons with configurable layout, orientation, and data binding. Presents mutually exclusive options where only one can be selected at a time. Supports data binding via Data property or static item declaration, configurable layout including orientation (Horizontal/Vertical), gap spacing, wrapping, alignment, and justification, custom item templates for complex radio button content, disabled items individually or for the entire list, and keyboard navigation (Arrow keys, Space, Enter) for accessibility. Use for forms where users must choose one option from several, like payment methods, shipping options, or preference settings.
Declaration
public RadzenRadioButtonList()
Examples
Static radio button list:
<RadzenRadioButtonList @bind-Value=@selectedOption TValue="string" Orientation="Orientation.Vertical">
<Items>
<RadzenRadioButtonListItem Text="Option 1" Value="option1" />
<RadzenRadioButtonListItem Text="Option 2" Value="option2" />
<RadzenRadioButtonListItem Text="Option 3" Value="option3" />
</Items>
</RadzenRadioButtonList>
Data-bound radio list with disabled item:
<RadzenRadioButtonList @bind-Value=@paymentMethod TValue="int" Data=@paymentMethods
TextProperty="Name" ValueProperty="Id" DisabledProperty="IsDisabled" />
Properties
AlignItems
Gets or sets the items alignment.
Declaration
[Parameter]
public AlignItems AlignItems { get; set; }
Property Value
| Type | Description |
|---|---|
| AlignItems | The items alignment. |
Data
Gets or sets the data.
Declaration
[Parameter]
public virtual IEnumerable Data { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable | The data. |
DisabledProperty
Gets or sets the disabled property.
Declaration
[Parameter]
public string DisabledProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The disabled property. |
Gap
Gets or sets the spacing between items
Declaration
[Parameter]
public string Gap { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The spacing between items. |
Items
Gets or sets the items.
Declaration
[Parameter]
public RenderFragment Items { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The items. |
JustifyContent
Gets or sets the content justify.
Declaration
[Parameter]
public JustifyContent JustifyContent { get; set; }
Property Value
| Type | Description |
|---|---|
| JustifyContent | The content justify. |
Orientation
Gets or sets the orientation.
Declaration
[Parameter]
public Orientation Orientation { get; set; }
Property Value
| Type | Description |
|---|---|
| Orientation | The orientation. |
TextProperty
Gets or sets the text property.
Declaration
[Parameter]
public string TextProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The text property. |
ValueProperty
Gets or sets the value property.
Declaration
[Parameter]
public string ValueProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The value property. |
VisibleProperty
Gets or sets the visible property.
Declaration
[Parameter]
public string VisibleProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The visible property. |
Wrap
Gets or sets the wrap.
Declaration
[Parameter]
public FlexWrap Wrap { get; set; }
Property Value
| Type | Description |
|---|---|
| FlexWrap | The wrap. |
Methods
AddItem(RadzenRadioButtonListItem<TValue>)
Adds the item.
Declaration
public void AddItem(RadzenRadioButtonListItem<TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| RadzenRadioButtonListItem<TValue> | item | The item. |
BuildRenderTree(RenderTreeBuilder)
A radio button group component that allows users to select a single option from a list of choices. RadzenRadioButtonList displays multiple radio buttons with configurable layout, orientation, and data binding. Presents mutually exclusive options where only one can be selected at a time. Supports data binding via Data property or static item declaration, configurable layout including orientation (Horizontal/Vertical), gap spacing, wrapping, alignment, and justification, custom item templates for complex radio button content, disabled items individually or for the entire list, and keyboard navigation (Arrow keys, Space, Enter) for accessibility. Use for forms where users must choose one option from several, like payment methods, shipping options, or preference settings.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
| Type | Description |
|---|---|
| string |
Overrides
IsSelected(RadzenRadioButtonListItem<TValue>)
Determines whether the specified item is selected.
Declaration
protected bool IsSelected(RadzenRadioButtonListItem<TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| RadzenRadioButtonListItem<TValue> | item | The item. |
Returns
| Type | Description |
|---|---|
| bool |
|
OnParametersSet()
A radio button group component that allows users to select a single option from a list of choices. RadzenRadioButtonList displays multiple radio buttons with configurable layout, orientation, and data binding. Presents mutually exclusive options where only one can be selected at a time. Supports data binding via Data property or static item declaration, configurable layout including orientation (Horizontal/Vertical), gap spacing, wrapping, alignment, and justification, custom item templates for complex radio button content, disabled items individually or for the entire list, and keyboard navigation (Arrow keys, Space, Enter) for accessibility. Use for forms where users must choose one option from several, like payment methods, shipping options, or preference settings.
Declaration
protected override void OnParametersSet()
Overrides
Refresh()
Refreshes this instance.
Declaration
public void Refresh()
RemoveItem(RadzenRadioButtonListItem<TValue>)
Removes the item.
Declaration
public void RemoveItem(RadzenRadioButtonListItem<TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| RadzenRadioButtonListItem<TValue> | item | The item. |
SelectItem(RadzenRadioButtonListItem<TValue>)
Selects the item.
Declaration
protected Task SelectItem(RadzenRadioButtonListItem<TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| RadzenRadioButtonListItem<TValue> | item | The item. |
Returns
| Type | Description |
|---|---|
| Task |