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.
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 |
コードのコピー
|
---|---|
@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); } } |