A segmented button control component that displays options as a group of connected buttons for single or multiple selection. RadzenSelectBar provides a visually distinct way to select from a limited set of options, commonly used for view modes, filters, or categories. Presents options as a row or column of connected buttons where selected items are highlighted. Ideal when you have 2-7 options and want a more prominent UI than radio buttons or checkboxes. Supports single selection (default) or multiple selection via Multiple property, Horizontal (side-by-side) or Vertical (stacked) button orientation, binding to a data source or static declaration of items, custom item templates with text/icons/images, ExtraSmall/Small/Medium/Large button sizes, disabled items, and keyboard navigation (Arrow keys and Space/Enter) for accessibility. Common uses include view toggles (list/grid), time period selectors (day/week/month), category filters, or any small set of mutually exclusive options.
FormComponent<TValue>.SetParametersAsync
FormComponent<TValue>.GetValue
FormComponent<TValue>.OnContextMenu
FormComponent<TValue>.GetClassList
FormComponent<TValue>.FocusAsync
FormComponent<TValue>.TabIndex
FormComponent<TValue>.Placeholder
FormComponent<TValue>.Disabled
FormComponent<TValue>.EditContext
FormComponent<TValue>.ValueChanged
FormComponent<TValue>.FieldIdentifier
FormComponent<TValue>.ValueExpression
FormComponent<TValue>.FormFieldContext
FormComponent<TValue>.CurrentPlaceholder
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenSelectBar<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent, IRadzenSelectBar| Name | Description |
|---|---|
| TValue | The type of the selected value. Can be a single value or IEnumerable for multiple selection. |
Basic select bar:
<RadzenSelectBar @bind-Value=@viewMode TValue="string">
<Items>
<RadzenSelectBarItem Text="List" Value="list" Icon="list" />
<RadzenSelectBarItem Text="Grid" Value="grid" Icon="grid_view" />
</Items>
</RadzenSelectBar>
Multiple selection for filters:
<RadzenSelectBar @bind-Value=@selectedCategories TValue="IEnumerable<int>" Multiple="true" Size="ButtonSize.Small">
<Items>
<RadzenSelectBarItem Text="Electronics" Value="1" />
<RadzenSelectBarItem Text="Clothing" Value="2" />
<RadzenSelectBarItem Text="Books" Value="3" />
</Items>
</RadzenSelectBar>A segmented button control component that displays options as a group of connected buttons for single or multiple selection. RadzenSelectBar provides a visually distinct way to select from a limited set of options, commonly used for view modes, filters, or categories. Presents options as a row or column of connected buttons where selected items are highlighted. Ideal when you have 2-7 options and want a more prominent UI than radio buttons or checkboxes. Supports single selection (default) or multiple selection via Multiple property, Horizontal (side-by-side) or Vertical (stacked) button orientation, binding to a data source or static declaration of items, custom item templates with text/icons/images, ExtraSmall/Small/Medium/Large button sizes, disabled items, and keyboard navigation (Arrow keys and Space/Enter) for accessibility. Common uses include view toggles (list/grid), time period selectors (day/week/month), category filters, or any small set of mutually exclusive options.
public RadzenSelectBar<TValue>()Gets or sets the data.
public Collections.IEnumerable Data { get; set; }
| Type | Description |
|---|---|
| Collections.IEnumerable | Gets or sets the data. |
Gets a value indicating whether this instance has value.
public bool HasValue { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether this instance has value. |
Gets or sets the items.
public RenderFragment Items { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the items. |
Gets or sets a value indicating whether this RadzenSelectBar<T> is multiple.
public bool Multiple { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether this RadzenSelectBar<T> is multiple. |
Gets or sets the layout direction of the select bar. Horizontal displays buttons side-by-side in a row, Vertical stacks buttons in a column.
public Orientation Orientation { get; set; }
| Type | Description |
|---|---|
| Orientation | Gets or sets the layout direction of the select bar. Horizontal displays buttons side-by-side in a row, Vertical stacks buttons in a column. |
Gets or sets the size of the buttons in the select bar. Controls the button padding, font size, and overall dimensions for all items.
public ButtonSize Size { get; set; }
| Type | Description |
|---|---|
| ButtonSize | Gets or sets the size of the buttons in the select bar. Controls the button padding, font size, and overall dimensions for all items. |
Gets or sets the text property.
public string TextProperty { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the text property. |
Gets or sets the value property.
public string ValueProperty { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the value property. |
Adds the item.
public void AddItem(RadzenSelectBarItem item)
| Type | Name | Description |
|---|---|---|
| RadzenSelectBarItem | item | The item. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Determines whether the specified item is selected.
protected bool IsSelected(RadzenSelectBarItem item)
| Type | Name | Description |
|---|---|---|
| RadzenSelectBarItem | item | The item. |
| Type | Description |
|---|---|
| bool | true if the specified item is selected; otherwise, false. |
Removes the item.
public void RemoveItem(RadzenSelectBarItem item)
| Type | Name | Description |
|---|---|---|
| RadzenSelectBarItem | item | The item. |
Selects the item.
protected Task SelectItem(RadzenSelectBarItem item)
| Type | Name | Description |
|---|---|---|
| RadzenSelectBarItem | item | The item. |
| Type | Description |
|---|---|
| Task |