DataGridSelection<T> Class

Provides data for the OptimizedMultipleSelectionChanged event.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.dll

Declaration

public class DataGridSelection<T>

Type Parameters

Name Description
T

A data model type.

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; }
    int StoredSelectedCount { get; set; }
    int StoredUnselectedCount { get; set; }

    protected void OnSelectionChanged(DataGridSelection<ProductFlat> selection)
    {
        StoredSelectedCount = selection.SelectedKeysStored.Count();
        StoredUnselectedCount = selection.UnselectedKeysStored.Count();
        SelectedCount = selection.SelectedKeys.Count();
    }
}

Online Demo

Data Grid - Multiple Selection with Optimized Performance

Inheritance

Object
DataGridSelection<T>
See Also