Blazor | ComponentOne
Controls / ListView / Selection Modes
In This Topic
    Selection Modes
    In This Topic

    By default, ListView allows you to select a single item from the displayed list. However, you can choose to select a range of items using SelectionMode property of the C1ListView class. The SelectionMode property manages how the items are selected in the ListView control and accepts values from the C1SelectionMode enumeration which specifies the selection behavior of the ListView control. It allows you to disable the selection, select a single item or a multiple items.

    multiple selection in ListView

    The following code shows the selection of multiple items in the ListView control. This example uses the Customer class created in the Virtualization topic.

    Razor
    Copy Code
    @using C1.Blazor.ListView
    
    <C1ListView ItemsSource="@customers" T="Customer" SelectionMode="C1SelectionMode.Multiple" DisplayMemberPath="Name" />
    
    @code
    {
        IEnumerable<Customer> customers;
        
        protected override void OnInitialized()
        {
            customers = Customer.GetCustomerList(100);
        }
    }