DataGridSelection<T>.SelectedKeysMatchingFilter Property

Specifies the keys of the selected data rows that match the filter criteria.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

public Task<IEnumerable<object>> SelectedKeysMatchingFilter { get; }

Property Value

Type Description
Task<IEnumerable<Object>>

The Task object that results the keys of the selected data rows that match the filter criteria.

Remarks

In the OptimizedMultipleSelectionChanged event handler, use the SelectedKeysMatchingFilter property to get the keys of the currently selected data rows that match the filter criteria asynchronously.

<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.SelectedKeysMatchingFilter;
        SelectedCount = selectedKeys.Count();
    }
}

Online Demo

Data Grid - Multiple Selection with Optimized Performance

See Also