Class SfButtonGroup
ButtonGroup is a container that groups a series of buttons on a single line. It has an optional radio button (single selection) and checkbox (multiple selection) behavior. It may contain DropDownButton or SplitButton component.
Inherited Members
Namespace: Syncfusion.Blazor.SplitButtons
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfButtonGroup : SfBaseComponent
Examples
In the below code example, a basic button group is initialized with ButtonGroupButton property.
<SfButtonGroup>
<ButtonGroupButton>Left</ButtonGroupButton>
<ButtonGroupButton>Center</ButtonGroupButton>
<ButtonGroupButton>Right</ButtonGroupButton>
</SfButtonGroup>
Constructors
SfButtonGroup()
Declaration
public SfButtonGroup()
Properties
Created
Gets or sets an event callback that is raised when the SfButtonGroup rendering is completed.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Examples
<SfButtonGroup Created="@Created">
<ButtonGroupButton>Left</ButtonGroupButton>
<ButtonGroupButton>Center</ButtonGroupButton>
<ButtonGroupButton>Right</ButtonGroupButton>
</SfButtonGroup>
@code {
private void Created() {
// Write your code here.
}
}
CssClass
Gets or sets a value that indicates CSS class string to customize the appearance of button group.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a CSS class string separated by space to customize the appearance of button group. The default value is |
Mode
Gets or sets a value that indicates the selection mode of the button group component.
Declaration
public SelectionMode Mode { get; set; }
Property Value
Type | Description |
---|---|
SelectionMode | One of the SelectionMode enumeration. The default value is Default |
Remarks
If the Mode
is Default
, it allows default selection in the button group component.
If the Mode
is Single
, it allows single selection in the button group component.
If the Mode
is Multiple
, it allows multiple selection in the button group component.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
OnAfterRenderAsync(Boolean)
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender |
Returns
Type |
---|
System.Threading.Tasks.Task |