Blazor 6.0 Radzen DataGrid not able to access System.Collections

498 Views Asked by At

I'm getting this error. AbsurdCollectionsError

Radzen components work for simple components. All required _layout.cshtml and _imports.razor additions are in place. I've followed the sample for OnInitialized from this link: https://blazor.radzen.com/docs/guides/components/datagrid.html

@page "/sqltest"


@using data_sql.Models
@using ds_admin.Data
@inject TestDatabaseService dbService

<h3>SqlTest</h3>

@if (reports == null)
{
    <p><em>Loading...</em></p>
}
else
{
    <RadzenDataGrid Data="@reports" TItem="Report" >
        <Columns>
            <RadzenDataGridColumn TItem="Report" Property="ReportDate" Title="Report Date" />
            <RadzenDataGridColumn TItem="Report" Property="Id" Title="Report Id" />
        </Columns>

    </RadzenDataGrid>  
   
}

@code {
    IEnumerable<Report> reports;

    public async Task OnInitializedAsync()
    {
        reports = await dbService.GetAcmfReportsAsync();
    }
}
0

There are 0 best solutions below