Blazor Radio Button - Double Click to remove selection

Hi There,
In Blazor serverside using the SfRadioButton I would like to remove selection when the user double-clicks the radio button. There isn't currently a native event for double click so could we do this somehow when the user clicks the button that is already selected?
Could you show a demo of how to do this?

2 Replies 1 reply marked as answer

GK Gayathri KarunaiAnandam Syncfusion Team February 9, 2021 01:32 PM UTC

Hi Andrew, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported query. We have provided the workaround solution for your requirement .In this sample,  we have customized the RadioButton by using ondblclick attribute as demonstrated in the below code snippet 
 
Index.razor 
 
<div @ondblclick="Click"> 
    <SfRadioButton Label="ON" Value="ON" @bind-Checked="Value"></SfRadioButton> 
    <SfRadioButton Label="OFF" Value="OFF" @bind-Checked="Value"></SfRadioButton> 
</div> 
 
@code { 
    private string Value = "ON"; 
 
    private void Click() 
    { 
        Value = ""; 
    } 
} 
 
 
For your reference, we have prepared a sample based on your requirement. Please check the below link. 
 
 
Please check the above link and get back to us, if you need further assistance. 
 
Regards, 
Gayathri K 


Marked as answer

PG Pon Geetha A J Syncfusion Team February 10, 2021 04:30 AM UTC

To: Syncfusion Support <[email protected]>
Subject: RE: Syncfusion support community forum 162320, Blazor Radio Button - Double Click to remove selection, has been updated.
 
Thanks – this works very well!! 


Loader.
Up arrow icon