DataGridSelection<T>.SelectedKeysStored Property

Specifies the stored keys of the selected data rows.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

public IEnumerable<object> SelectedKeysStored { get; }

Property Value

Type Description
IEnumerable<Object>

The stored keys of the selected data rows.

Remarks

In the OptimizedMultipleSelectionChanged event handler, use the SelectedKeysStored property to get the keys of the stored selected data rows. This property does not store keys if you select all data rows. In this case, the grid stores keys of the unselected data rows (UnselectedKeysStored).

<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

See Also