Grid does not render output using Page model ASP.NET Core 3.1

3 posts, 0 answers
  1. Mark
    Mark avatar
    2 posts
    Member since:
    Dec 2018

    Posted 22 Mar 2020 Link to this post

     

    Using ASP.NET Core 3.1 Razor Pages

     

    Page Model:

            public IList<Label> Label { get;set; }

            public async Task OnGetAsync()
            {

                Label = await _context.Labels
                    .ToListAsync();

           }

    Page: This renders no output at all on the Razor page even though debugging shows records in Model.Label.

    I've also noticed that the standard table bound to the same data will work until this code is added to the page, it then also renders nothing. Other controls work fine.

    @(

        Html.Kendo().Grid(Model.Label)
        .Name("label-grid")
        .Columns(columns =>
        {
            columns.Bound(c => c.ProductId).Title("Item");
            columns.Bound(c => c.Template);
            columns.Bound(c => c.Family);
            columns.Bound(c => c.ProductLine);
            columns.Bound(c => c.EdgeDetail);
            columns.Bound(c => c.GridSize);
            columns.Bound(c => c.Size);
        })

    )

  2. Ianko
    Admin
    Ianko avatar
    1949 posts

    Posted 25 Mar 2020 Link to this post

    Hello Mark,

    I tested with some dummy data, but I was unable to reproduce the described problem. 

    I am attaching a sample project to take a look. 

    Regards,
    Ianko
    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.
  3. Mark
    Mark avatar
    2 posts
    Member since:
    Dec 2018

    Posted 27 Mar 2020 Link to this post

    I was able to resolve this issue. It seems the issue was that I was using the actual model entity which was evidently too complex. I used a simplified ViewModel version of the entity and it works. Thanks
Back to Top