DxListBox<TData, TValue>.DeselectAllAsync() Method
Deselects all available items in the List Box.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public Task DeselectAllAsync()
Returns
Type | Description |
---|---|
Task | The task that is completed when all available items are deselected. |
Remarks
Call the DeselectAllAsync
method to clear all selectable List Box items. This method does not affect items hidden by a filter or disabled items.
To select all items, call the SelectAllAsync() 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