Default Radio button

How to default the date today using radio button string?


3 Replies

BC Belle Cruz February 14, 2022 07:13 AM UTC

Is there any update about my query?




JS Janakiraman Sakthivel Syncfusion Team February 15, 2022 02:39 AM UTC

Hi Belle Cruz, 
 
Thank you for contacting Syncfusion support. 
 
We need to validate more on the reported query, so will update you the further details on February 16th, 2022. 
 
Regards, 
Janakiraman S. 



JS Janakiraman Sakthivel Syncfusion Team February 16, 2022 06:00 PM UTC

Hi Belle Cruz, 
 
We are able to achieve your requirement by using the below shown code. 
 
[Index.razor]:  
<div class="control-section"> 
    <div class="radio-control"> 
        <h4 class="row">Select a payment method</h4> 
        <div class="row"> 
            <SfRadioButton Label="2/15/2022" Name="payment" Value="15-2-2022" Checked="@checkedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="2/16/2022" Name="payment" Value="16-2-2022" Checked="@checkedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="2/17/2022" Name="payment" Value="17-2-2022" Checked="@checkedValue"></SfRadioButton> 
        </div> 
        <div class="row"> 
            <SfRadioButton Label="2/18/2022" Name="payment" Value="18-2-2022" Checked="@checkedValue"></SfRadioButton> 
        </div> 
    </div> 
</div> 
@code { 
    private string checkedValue = DateTime.Now.Date.ToString("dd-M-yyyy"); 
} 
 
  
For your convenience, we have prepared the sample to achieve your requirement. Please find the sample link below, 
 
 
Could you please check the above links and explain your query in detail, if we misunderstood your requirement or if you need any further assistance on this? Based on that we will check and provide you a better solution quickly. 
 
Regards, 
Janakiraman S.

Loader.
Up arrow icon