Skip to main content
All docs
V25.1
  • Item Selection

    • 3 minutes to read

    Use the SelectionMode property to specify the selection mode: Single (default), Multiple, or None.

    Single Selection

    The default selection mode is Single. Users can select one List Box item at a time.

    Use the Value property to access/specify the selected item in code. To respond to selection changes, handle the ValueChanged event.

    Run Demo: List Box - Overview

    Multiple Selection

    Set the SelectionMode property to ListBoxSelectionMode.Multiple to enable multiple selection in the List Box.

    Users can select multiple items in several ways:

    • Press Ctrl to select items individually or hold Shift to select a range of items.
    • Click individual items or corresponding checkboxes (available if ShowCheckboxes is enabled).
    • Click the Select All checkbox (available if both ShowSelectAllCheckbox and ShowCheckboxes are enabled). The Select All checkbox does not affect items hidden by a filter or disabled items.

    Use the Values property to access/specify selected items in multiple selection mode. To respond to selection changes, handle the ValuesChanged event.

    You can use SelectAllAsync() and DeselectAllAsync() methods to select/deselect all available items in code.

    The following code enables multiple selection in the List Box, adds checkboxes to items, and shows the Select All checkbox:

    @using StaffData
    
    <DxListBox Data="@Staff.DataSource"
               TextFieldName="@nameof(Person.Text)"
               SelectionMode="ListBoxSelectionMode.Multiple"
               ShowCheckboxes="true"
               ShowSelectAllCheckbox="true"
               @bind-Values="@Values">
    </DxListBox>
    
    @code {
        IEnumerable<Person> Values { get; set; }
    }
    

    ListBox ShowCheckboxes

    Run Demo: List Box - Multiple Selection

    Disable Selection

    Set the SelectionMode property to ListBoxSelectionMode.None to disable selection in the List Box.