Data loaded is not loading into Radzen data grid nor are headers loading

Current code :


@using Infrastructure.ViewModels
@using ERM.Common.Util;
@using static ComponentLibrary.Model.PageStatus
@inject IUnitOfWork UnitOfWork
<h5>This Months @ReportTitle Activity</h5>
<br />

<RadzenDataGrid @ref="grid"
                IsLoading=@_isLoading
                AllowPaging="true"
                AllowSorting="true"
                Data="@ReportData"
                style="height: 335px"
                LoadData="@LoadData"
                PagerHorizontalAlign="HorizontalAlign.Center"
                TItem="ActivityReportViewModel">
    <RadzenDataGridColumn TItem="ActivityReportViewModel" Title="Institution Name" Property="InstitutionName" />
    <RadzenDataGridColumn TItem="ActivityReportViewModel" Title="State" Property="StateName" />
    <RadzenDataGridColumn TItem="ActivityReportViewModel" Title="Sales Rep" Property="SalesRep" />
    <RadzenDataGridColumn TItem="ActivityReportViewModel" Title="Date Created" Property="CDate">
        <Template Context="data">
            @DisplayFormatting.FormatDateString(data.CDate)
        </Template>
    </RadzenDataGridColumn>
</RadzenDataGrid>


@code {

    RadzenDataGrid<ActivityReportViewModel> grid;
    [Parameter]
    public int? ReportType { get; set; }

    [Parameter]
    public int? StateId { get; set; }
    public string ReportTitle { get; set; }

    private Status _status { get; set; }

    bool _isLoading { get; set; } = false;

    private IEnumerable<ActivityReportViewModel> ReportData { get; set; }

    //protected override async Task OnInitializedAsync()
    //{

    //   await LoadData();
    //}

    private async Task LoadData()
    {
        ReportData = new List<ActivityReportViewModel>();
        _isLoading = true;
        //await Task.Yield();

        switch (ReportType)
        {
            case 1:
                ReportData = await UnitOfWork.Proposal.ReportActivity(StateId);
                ReportTitle = "Proposal";
                break;
            case 2:
                ReportData = await UnitOfWork.Touch.ReportActivity(StateId);
                ReportTitle = "Touch";
                break;
            case 3:
                ReportData = await UnitOfWork.Prospects.ReportActivity(StateId);
                ReportTitle = "Prospects";
                break;
            default:
                break;

        }
        _isLoading = false;
        await InvokeAsync(StateHasChanged);
    }

}

When debugging for Proposal ReportData show 54 records loaded as page is rerender by await InvokeAsync(StateHasChanged);

Keep getting this page

I'm at a loss as I've used these RadzenDataGrid several times and have never ran into this type of issue.

Any suggestion would be appreciated

You’ve missed to set Count - this is needed when binding with LoadData, check our demos for reference.

Thanks for the help, it moved me forward but still not loading headers or rows.?

I've tried commenting out and only have one column load with no luck
Am I missing something with the RadzenDataGridColumn ???

I’m afraid that I don’t see anything else missing. If you have Radzen subscription you can send us at info@radzen.com your application to debug it.

Thanks for looking, I'll just step back and try to rebuild it as a note I just tested adding an existing data grid to my test page and this just stupidly funny to me ....

I will try to figure out why one is working and the other isn't lol sadly we don have a subscription yet though I may push for us to get one once we go live if needed. :slight_smile:

I did just notice I'm getting this error
image

...facepalm did not have the tag included in my markup sighs....