DxListBox<TData, TValue>.SelectAllAsync() Method
Selects all available items in the List Box.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public Task SelectAllAsync()
Returns
Type | Description |
---|---|
Task | The task that is completed when all available items are selected. |
Remarks
Call the SelectAllAsync
method to select all selectable List Box items. This method does not affect items hidden by a filter or disabled items.
To deselect all items, call the DeselectAllAsync() method.
To access selected items, implement two-way binding for the Values property or handle the SelectedDataItemsChanged event.
<DxButton Click="SelectAll">Select All Items</DxButton>
<DxButton Click="DeselectAll">Deselect All Items</DxButton>
<DxListBox Data="@Staff.DataSource"
@ref=MyListBox
TextFieldName="@nameof(Person.Text)"
SelectionMode="ListBoxSelectionMode.Multiple"
ShowCheckboxes="true"
ShowSelectAllCheckbox="true"
@bind-Values="@Values">
</DxListBox>
@code {
IListBox<Person,Person> MyListBox { get; set; }
IEnumerable<Person> Values { get; set; }
async Task SelectAll(MouseEventArgs args) {
await MyListBox.SelectAllAsync();
}
async Task DeselectAll(MouseEventArgs args) {
await MyListBox.DeselectAllAsync();
}
}
Implements
See Also