Radio Button

How do i get which Radio Button the user selected?

1 Reply 1 reply marked as answer

MK Mohan Kumar Ramasamy Syncfusion Team November 9, 2020 10:50 AM UTC

Hi Paul, 
 
We have checked your reported query, we have get the selected button using two way binding Checked property. Please refer below code snippets. 
 
 
@using Syncfusion.Blazor.Buttons 
 
<div class="control-section"> 
    <div class="radio-control"> 
        <h4 class="row">Choose an employment status - @CheckedValue</h4> 
        <div class="row"> 
            <SfRadioButton Label="Unspecified" Name="status" Value="Unspecified" @bind-Checked="@CheckedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="Trainee" Name="status" Value="Trainee" @bind-Checked="@CheckedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="Probationary" Name="status" Value="Probationary" @bind-Checked="@CheckedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="Regular" Name="status" Value="Regular" @bind-Checked="@CheckedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="Retired" Name="status" Value="Retired" @bind-Checked="@CheckedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="Dismissed" Name="status" Value="Dismissed" @bind-Checked="@CheckedValue"></SfRadioButton> 
        </div> 
    </div> 
</div> 
 
@code 
{ 
    private string CheckedValue = "Trainee"; 
 
} 
 
 
 
For your reference, we have prepared a sample based on this. Please refer below link. 
 
 
Please let us know, if you need any further assistance 
 
Regards, 
Mohan kumar R 


Marked as answer
Loader.
Up arrow icon