You can define the native event using on event
attribute in component. The value of attribute is treated as an event handler. The event specific data will be available in event arguments.
The different event argument types for each event are,
We have provided the following native event support to the Radio Button component:
List of Native events | ||||
---|---|---|---|---|
onchange | oninput | onblur | onfocus | onfocusout |
onfocusin | onclick | onkeydown | onkeyup | Onkeypress |
The onclick
attribute is used to bind the click event for Radio Button. Here, we have explained about the sample code snippets of Radio Button.
@using Syncfusion.Blazor.Buttons
<SfRadioButton Label="Credit/Debit Card" Name="payment" Value="credit/debit" @onclick="onClick" @bind-Checked="stringChecked"></SfRadioButton><br />
<SfRadioButton Label="Net Banking" Name="payment" Value="netbanking" @onclick="onClick" @bind-Checked="stringChecked"></SfRadioButton>
@code {
private string stringChecked = "netbanking";
private void onClick(Microsoft.AspNetCore.Components.Web.MouseEventArgs args){
//onclick Event triggered
}
}