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

**URL:** <https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626>\
**Category:** Radzen.Blazor Components\
**Created:** [August 25, 2022, 6:36pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626 "2022-08-25T18:36:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sir\_John\_Balman](https://forum.radzen.com/user_avatar/forum.radzen.com/sir_john_balman/32/8904_2.png) [@Sir\_John\_Balman](https://forum.radzen.com/u/Sir_John_Balman)\
**Post date:** [August 25, 2022, 6:36pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/1 "2022-08-25T18:36:11Z")

</div>

Current code :

```auto

@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

 ![image](https://forum.radzen.com/uploads/default/original/2X/c/c8eb70e4e247579005c414123967136ad1233c28.png)

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

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [August 25, 2022, 7:42pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/2 "2022-08-25T19:42:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sir\_John\_Balman](https://forum.radzen.com/user_avatar/forum.radzen.com/sir_john_balman/32/8904_2.png) [@Sir\_John\_Balman](https://forum.radzen.com/u/Sir_John_Balman)\
**Post date:** [August 25, 2022, 7:50pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/3 "2022-08-25T19:50:02Z")

</div>

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

 ![image](https://forum.radzen.com/uploads/default/original/2X/8/86885ffc98e89c3c0bc2d9029b9e342c2fbbffad.png)

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

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [August 26, 2022, 3:57am UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/4 "2022-08-26T03:57:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sir\_John\_Balman](https://forum.radzen.com/user_avatar/forum.radzen.com/sir_john_balman/32/8904_2.png) [@Sir\_John\_Balman](https://forum.radzen.com/u/Sir_John_Balman)\
**Post date:** [August 26, 2022, 7:05pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/5 "2022-08-26T19:05:30Z")

</div>

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 ....

 ![image](https://forum.radzen.com/uploads/default/original/2X/a/a2c3373dfbfa6e7fcbae30df68b0d7ffb7210d98.png)

![image](https://forum.radzen.com/uploads/default/optimized/2X/9/9baf7aee6b16e31e91b3689e26aecbaceb1561d6_2_690x33.png)

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. 🙂

---

<div class="post-metadata">

**Author:** ![Sir\_John\_Balman](https://forum.radzen.com/user_avatar/forum.radzen.com/sir_john_balman/32/8904_2.png) [@Sir\_John\_Balman](https://forum.radzen.com/u/Sir_John_Balman)\
**Post date:** [August 26, 2022, 8:03pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/6 "2022-08-26T20:03:50Z")

</div>

I did just notice I'm getting this error

 ![image](https://forum.radzen.com/uploads/default/original/2X/e/e90acff5afb3583fd75ea94934ec818a5e175caf.png)

---

<div class="post-metadata">

**Author:** ![Sir\_John\_Balman](https://forum.radzen.com/user_avatar/forum.radzen.com/sir_john_balman/32/8904_2.png) [@Sir\_John\_Balman](https://forum.radzen.com/u/Sir_John_Balman)\
**Post date:** [August 29, 2022, 6:24pm UTC](https://forum.radzen.com/t/data-loaded-is-not-loading-into-radzen-data-grid-nor-are-headers-loading/11626/7 "2022-08-29T18:24:38Z")

</div>

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