Completed
Last Updated: 27 Apr 2020 09:42 by ADMIN
Release 2.13.0
Toni
Created on: 24 Apr 2020 15:24
Category: UI for Blazor
Type: Bug Report
0
Using OnStateInit with SelectedItems throws a null reference when the collection is initialized with Enumerable.Empty
Does not seem to be an issue when the grid state is not used.
1 comment
ADMIN
Marin Bratanov
Posted on: 24 Apr 2020 15:27

If we take the example from the docs (link), a workaround is to initialize the collection with a list:

 

public IEnumerable<SampleData> SelectedItems { get; set; } = new List<SampleData>();

 

The issue is due to a bug in the framework where Enumerable.Empty() resolves to null: https://github.com/dotnet/runtime/issues/27552.

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.