DxDataGridBase<T>.OptimizedMultipleSelectionChanged Event

Occurs when a user changed selection in optimized multiple selection mode.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.dll

Declaration

[Parameter]
public Func<DataGridSelection<T>, Task> OptimizedMultipleSelectionChanged { get; set; }

Parameters

Type Description
DataGridSelection<T>

A DataGridSelection<T> object.

Remarks

Handle the OptimizedMultipleSelectionChanged event to track selection changes in multiple selection mode with optimized performance.

<DxDataGrid Data="@DataSource"
    KeyFieldName="Id"
    SelectionMode="DataGridSelectionMode.OptimizedMultipleSelection"
    OptimizedMultipleSelectionChanged="OnSelectionChanged">
    ...
</DxDataGrid>

@code {
    int SelectedCount { get; set; }

    protected async Task OnSelectionChanged(DataGridSelection<ProductFlat> selection) {
        ...
        var selectedKeys = await selection.SelectedKeys;
        SelectedCount = selectedKeys.Count();
    }
}
NOTE

To use the multiple selection with optimized performance, do the following:

Online Demo

Data Grid - Multiple Selection with Optimized Performance

See Also