Class SfRadioButton<TChecked>
RadioButton is a graphical user interface element that allows you to select one option from the choices. It has checked and unchecked states.
Inherited Members
Namespace: Syncfusion.Blazor.Buttons
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfRadioButton<TChecked> : SfInputBase<TChecked>
Type Parameters
Name |
---|
TChecked |
Examples
In the below code example, a basic radiobutton is initialized with Checked
property.
<SfRadioButton Checked="true">
</SfRadioButton>
Constructors
SfRadioButton()
Declaration
public SfRadioButton()
Properties
Label
Gets or sets a value that indicates the label of radio button.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a string value. The default value is |
LabelPosition
Gets or sets a value that indicates how to display label in the radio button.
Declaration
public LabelPosition LabelPosition { get; set; }
Property Value
Type | Description |
---|---|
LabelPosition | One of the LabelPosition enumeration. The default value is Before |
Remarks
If the LabelPosition
is Before
, the label will be placed to the left side of the Radio Button.
If the LabelPosition
is After
, the icon will be placed to the right side of the Radio Button.
ValueChange
Gets or sets an event callback that is raised when the radio button state is changed.
Declaration
public EventCallback<ChangeArgs<TChecked>> ValueChange { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ChangeArgs<TChecked>> | An event callback function. |
Remarks
The event is raised for UI based click only.
Examples
<SfRadioButton ValueChange="@Changed">
</SfRadioButton>
@code {
private void Changed(ChangeEventArgs<TChecked> args) {
// Write your code here.
}
}
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
InitRender()
Declaration
protected override void InitRender()
Overrides
OnAfterRenderAsync(Boolean)
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender |
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |