alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ListBoxSelectionSettings

    Configures the selection options for a SfListBox<TValue, TItem>, mapping checkbox position, selection mode, and select-all behaviors.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    ListBoxSelectionSettings
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ListBoxSelectionSettings : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    Use this class to define how users interact with selection features in a ListBox—such as enabling checkboxes, placing them, or choosing between single and multiple selection modes.

    Examples

    This example shows configuring a ListBox with selection settings for single selection:

    <SfListBox Value="@value" DataSource="@vehicleData" TValue="string[]" TItem="ListItem">
        <ListBoxFieldSettings Text="Text" Value="ID"></ListBoxFieldSettings>
        <ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single"></ListBoxSelectionSettings>
    </SfListBox>
    @code {
        private string[] value = new[] { "List-01" };
        private List<ListItem> vehicleData = new List<ListItem> {
            new ListItem { Text = "Hennessey Venom", ID = "List-01" },
            new ListItem { Text = "Bugatti Chiron", ID = "List-02" },
            new ListItem { Text = "Bugatti Veyron Super Sport", ID = "List-03" }
        };
        public class ListItem { public string Text { get; set; } public string ID { get; set; } }
    }

    Constructors

    ListBoxSelectionSettings()

    Declaration
    public ListBoxSelectionSettings()

    Properties

    CheckboxPosition

    Gets or sets the placement of the checkbox within each list item.

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

    One of the CheckBoxPosition enumeration values: Left (default), or Right.

    Remarks

    If Left is set, the checkbox displays to the left of the item's label; if Right, it displays to the right.

    Mode

    Gets or sets the mode of selection supported (single or multiple selection) for the ListBox.

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

    The SelectionMode: Single (one item select) or Multiple (default, multiple item select).

    Remarks
    • Single: Only one list item can be selected at a time.
    • Multiple: Multiple list items can be selected at once.

    ShowCheckbox

    Enables or disables the display of the selection checkbox for each ListBox item.

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

    true to enable checkbox selection UI; false to disable it. The default is false.

    Remarks

    If enabled, checkboxes are rendered next to each item for easy multi-selection. This property is commonly turned on for list selection scenarios.

    ShowSelectAll

    Enables or disables the "Select All" checkbox option in the ListBox.

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

    true displays a select-all checkbox above the list; false (default) hides it.

    Remarks

    Note: The select-all checkbox is only available when ShowCheckbox is set to true—otherwise, this property has no effect.

    Examples

    This example shows enabling checkboxes and the select-all option:

    <SfListBox Value="@value" DataSource="@vehicleData" TValue="string[]" TItem="ListItem">
        <ListBoxFieldSettings Text="Text" Value="ID"></ListBoxFieldSettings>
        <ListBoxSelectionSettings ShowCheckbox="true" ShowSelectAll="true"></ListBoxSelectionSettings>
    </SfListBox>

    Methods

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    OwningComponentBase.Dispose(bool)

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    Task
    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved