alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SfRadioButton<TChecked>

    Represents a RadioButton component, which is a graphical interface element that allows users to select a single option from a group. It supports checked and unchecked states for user interaction and custom logic.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    SfBaseComponent
    SfInputBase<TChecked>
    SfRadioButton<TChecked>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(bool)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnObservableChange(string, object, bool, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    SfInputBase<TChecked>.Checked
    SfInputBase<TChecked>.Created
    SfInputBase<TChecked>.CssClass
    SfInputBase<TChecked>.Disabled
    SfInputBase<TChecked>.EnablePersistence
    SfInputBase<TChecked>.EnableRtl
    SfInputBase<TChecked>.FocusAsync()
    SfInputBase<TChecked>.GetPersistData()
    SfInputBase<TChecked>.Name
    SfInputBase<TChecked>.SetLocalStorage(string, TChecked)
    SfInputBase<TChecked>.UpdateCheckState(TChecked)
    SfInputBase<TChecked>.Value
    Namespace: Syncfusion.Blazor.Buttons
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfRadioButton<TChecked> : SfInputBase<TChecked>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Type Parameters
    Name
    TChecked
    Remarks

    This generic component allows flexible data binding to various types for checked state tracking. The RadioButton supports RTL, persistence, label positioning, and can be easily customized via its component parameters. This class should be used when you want to offer a mutually exclusive choice selection within a UI form or group.

    Examples

    The following example demonstrates how to initialize a basic radio button using the Checked property.

    <SfRadioButton Checked="true">
    </SfRadioButton>

    Constructors

    SfRadioButton()

    Declaration
    public SfRadioButton()

    Properties

    Label

    Gets or sets the label displayed next to the radio button.

    Declaration
    [Parameter]
    public string Label { get; set; }
    Property Value
    Type Description
    string

    A string that specifies the display label of the radio button. The default is String.Empty.

    Remarks

    Use this property to assign custom text to the radio button's label, allowing users to distinguish between radio button options. Leaving this value empty will hide the label from the rendered output.

    LabelPosition

    Gets or sets the position of the label in relation to the radio button.

    Declaration
    [Parameter]
    public LabelPosition LabelPosition { get; set; }
    Property Value
    Type Description
    LabelPosition

    One of the LabelPosition enumeration values. The default is Before.

    Remarks

    If the LabelPosition is Before, the label appears to the left of the radio button. If set to After, the label appears to the right of the radio button. This property helps control the element flow for better localization and accessibility.

    ValueChange

    Gets or sets an event callback that is invoked when the state of the radio button changes due to user interaction.

    Declaration
    [Parameter]
    public EventCallback<ChangeArgs<TChecked>> ValueChange { get; set; }
    Property Value
    Type Description
    EventCallback<ChangeArgs<TChecked>>

    An EventCallback<ChangeArgs<TChecked>> that is triggered when the state of the radio button is changed by the user. The callback receives a ChangeArgs<TChecked> argument.

    Remarks

    This event is raised only in response to user-based click actions on the radio button. You can use it to perform custom logic or UI updates whenever the checked state is modified by end-users.

    Examples

    The following example shows how to use the ValueChange event for the radio button:

    <SfRadioButton ValueChange="@Changed">
    </SfRadioButton>
    @code {
        private void Changed(ChangeArgs<TChecked> args)
        {
            // Custom handler code goes here.
        }
    }

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    InitRender(bool)

    Declaration
    protected override void InitRender(bool isDynamic = false)
    Parameters
    Type Name Description
    bool isDynamic
    Overrides
    SfInputBase<TChecked>.InitRender(bool)

    OnAfterRenderAsync(bool)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    bool firstRender

    Set to true for the first time component rendering; otherwise gets false.

    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Overrides
    SfInputBase<TChecked>.OnAfterRenderAsync(bool)

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Overrides
    SfInputBase<TChecked>.OnInitializedAsync()

    OnParametersSetAsync()

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    Task
    Overrides
    SfInputBase<TChecked>.OnParametersSetAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved