RadzenSelectBar<TValue> Class

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.

Inheritance

Object

ComponentBase

RadzenComponent

FormComponent<TValue>

RadzenSelectBar<TValue>

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

IRadzenSelectBar

Inherited Members

FormComponent<TValue>.SetParametersAsync

FormComponent<TValue>.Dispose

FormComponent<TValue>.GetValue

FormComponent<TValue>.OnContextMenu

FormComponent<TValue>.GetClassList

FormComponent<TValue>.FocusAsync

FormComponent<TValue>.Name

FormComponent<TValue>.TabIndex

FormComponent<TValue>.Placeholder

FormComponent<TValue>.Disabled

FormComponent<TValue>.EditContext

FormComponent<TValue>.Form

FormComponent<TValue>.ValueChanged

FormComponent<TValue>.IsBound

FormComponent<TValue>.Value

FormComponent<TValue>.Change

FormComponent<TValue>.FieldIdentifier

FormComponent<TValue>.ValueExpression

FormComponent<TValue>.FormFieldContext

FormComponent<TValue>.CurrentPlaceholder

FormComponent<TValue>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

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

Syntax

public class RadzenSelectBar<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent, IRadzenSelectBar

Type Parameters

Name Description
TValueThe type of the selected value. Can be a single value or IEnumerable for multiple selection.

Examples

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>

Constructors

RadzenSelectBar<TValue>link

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.

Declaration
public RadzenSelectBar<TValue>()

Properties

Datalink

Gets or sets the data.

Declaration
public Collections.IEnumerable Data { get; set; }
Property Value
Type Description
Collections.IEnumerableGets or sets the data.

HasValuelink

Gets a value indicating whether this instance has value.

Declaration
public bool HasValue { get; }
Property Value
Type Description
boolGets a value indicating whether this instance has value.

Itemslink

Gets or sets the items.

Declaration
public RenderFragment Items { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the items.

Multiplelink

Gets or sets a value indicating whether this RadzenSelectBar<T> is multiple.

Declaration
public bool Multiple { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this RadzenSelectBar<T> is multiple.

Orientationlink

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.

Declaration
public Orientation Orientation { get; set; }
Property Value
Type Description
OrientationGets or sets the layout direction of the select bar. Horizontal displays buttons side-by-side in a row, Vertical stacks buttons in a column.

Sizelink

Gets or sets the size of the buttons in the select bar. Controls the button padding, font size, and overall dimensions for all items.

Declaration
public ButtonSize Size { get; set; }
Property Value
Type Description
ButtonSizeGets or sets the size of the buttons in the select bar. Controls the button padding, font size, and overall dimensions for all items.

TextPropertylink

Gets or sets the text property.

Declaration
public string TextProperty { get; set; }
Property Value
Type Description
stringGets or sets the text property.

ValuePropertylink

Gets or sets the value property.

Declaration
public string ValueProperty { get; set; }
Property Value
Type Description
stringGets or sets the value property.

Methods

AddItemlink

Adds the item.

Declaration
public void AddItem(RadzenSelectBarItem item)
Parameters
Type Name Description
RadzenSelectBarItem item The item.

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

IsSelectedlink

Determines whether the specified item is selected.

Declaration
protected bool IsSelected(RadzenSelectBarItem item)
Parameters
Type Name Description
RadzenSelectBarItem item The item.
Returns
Type Description
booltrue if the specified item is selected; otherwise, false.

OnParametersSetlink

Declaration
protected override void OnParametersSet()

Refreshlink

Refreshes this instance.

Declaration
public void Refresh()

RemoveItemlink

Removes the item.

Declaration
public void RemoveItem(RadzenSelectBarItem item)
Parameters
Type Name Description
RadzenSelectBarItem item The item.

SelectItemlink

Selects the item.

Declaration
protected Task SelectItem(RadzenSelectBarItem item)
Parameters
Type Name Description
RadzenSelectBarItem item The item.
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙