Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenSelectBar<TValue>

    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
    IDisposable
    IRadzenFormComponent
    IRadzenSelectBar
    Inherited Members
    FormComponent<TValue>._value
    FormComponent<TValue>.SetParametersAsync(ParameterView)
    FormComponent<TValue>.Dispose()
    FormComponent<TValue>.GetValue()
    FormComponent<TValue>.OnContextMenu(MouseEventArgs)
    FormComponent<TValue>.GetClassList(string)
    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
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, int)
    RadzenComponent.OnInitialized()
    RadzenComponent.OnAfterRenderAsync(bool)
    RadzenComponent.RaiseContextMenu(MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.AddContextMenu()
    RadzenComponent.RaiseMouseLeave()
    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(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenSelectBar<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent, IRadzenSelectBar
    Type Parameters
    Name Description
    TValue

    The 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()

    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()
    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>

    Properties

    Data

    Gets or sets the data.

    Declaration
    [Parameter]
    public virtual IEnumerable Data { get; set; }
    Property Value
    Type Description
    IEnumerable

    The data.

    HasValue

    Gets a value indicating whether this instance has value.

    Declaration
    public override bool HasValue { get; }
    Property Value
    Type Description
    bool

    true if this instance has value; otherwise, false.

    Overrides
    FormComponent<TValue>.HasValue

    Items

    Gets or sets the items.

    Declaration
    [Parameter]
    public RenderFragment Items { get; set; }
    Property Value
    Type Description
    RenderFragment

    The items.

    Multiple

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

    Declaration
    [Parameter]
    public bool Multiple { get; set; }
    Property Value
    Type Description
    bool

    true if multiple; otherwise, false.

    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.

    Declaration
    [Parameter]
    public Orientation Orientation { get; set; }
    Property Value
    Type Description
    Orientation

    The orientation. Default is Horizontal.

    Size

    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
    [Parameter]
    public ButtonSize Size { get; set; }
    Property Value
    Type Description
    ButtonSize

    The button size. Default is Medium.

    TextProperty

    Gets or sets the text property.

    Declaration
    [Parameter]
    public string TextProperty { get; set; }
    Property Value
    Type Description
    string

    The text property.

    ValueProperty

    Gets or sets the value property.

    Declaration
    [Parameter]
    public string ValueProperty { get; set; }
    Property Value
    Type Description
    string

    The value property.

    Methods

    AddItem(RadzenSelectBarItem)

    Adds the item.

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

    The item.

    BuildRenderTree(RenderTreeBuilder)

    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
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    string
    Overrides
    RadzenComponent.GetComponentCssClass()

    IsSelected(RadzenSelectBarItem)

    Determines whether the specified item is selected.

    Declaration
    protected bool IsSelected(RadzenSelectBarItem item)
    Parameters
    Type Name Description
    RadzenSelectBarItem item

    The item.

    Returns
    Type Description
    bool

    true if the specified item is selected; otherwise, false.

    OnParametersSet()

    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
    protected override void OnParametersSet()
    Overrides
    ComponentBase.OnParametersSet()

    Refresh()

    Refreshes this instance.

    Declaration
    public void Refresh()

    RemoveItem(RadzenSelectBarItem)

    Removes the item.

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

    The item.

    SelectItem(RadzenSelectBarItem)

    Selects the item.

    Declaration
    protected Task SelectItem(RadzenSelectBarItem item)
    Parameters
    Type Name Description
    RadzenSelectBarItem item

    The item.

    Returns
    Type Description
    Task

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent
    IRadzenSelectBar

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT