This is a migrated thread and some comments may be shown as answers.

Grid does not render with Commands

6 Answers 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Veteran
Dan asked on 27 Jan 2021, 08:10 PM

I am attempting to create a grid that has the Edit (Update) command available.

When I run the application with the edit options commented out it renders, but when I leave them in I get no errors on the front end and the page is blank. The read controller is not even being hit.

Here is the view code. Any ideas? It seems adding the Edit options somehow breaks the grid.

 

@using Kendo.Mvc.UI
 
@(Html.Kendo().Grid<HoldingOvenEditor.Models.HOGridModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(p => p.OvenName);
 
                columns.Command(command => { command.Edit(); }).Width(160); //<= Comment this out to work correctly
            })
            .Editable(editable => editable.Mode(GridEditMode.PopUp)) //<= Comment this out to work correctly
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model => {
                    model.Id(p => p.OvenName);
                    model.Field(x => x.OvenName).Editable(true);
 
                })
                .Read(read => read.Action("ResourceGrid_Read", "Grid"))
                .Update(update => update.Action("EditingPopup_Update", "Grid")) //<= Comment this out to work correctly
 
    )
)

6 Answers, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 01 Feb 2021, 10:09 AM

Hello Dan,

Thank you for the code snippet and details.

I tried to replicate the faulty behavior and created the same Kendo UI Grid. The PopUp Editing and Read methods are working as expected.

Find attached a sample project with the needed implementation. Try to replicate the issue and send it back to me in this thread. Another approach is to provide a runnable, isolated, sample project. Examining this project will let us replicate the issue locally and further troubleshoot it.

Looking forward to hearing back from you.

 

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Dan
Top achievements
Rank 1
Veteran
answered on 01 Feb 2021, 02:30 PM

Anton,

For some odd reason when I attempt to run the same you provided, the project properties are targeting .net framework and will not allow me to target .net core. Not sure whats going on there.

I can't really provide you with a sample of the current project without creating a brand new one and making things generic because of company policy. In that event I would bet it works. (I have other .net core 3.1 MVC projects and they are working fine with grid rendering)

Is there any common issues with rendering I can try to resolve before I give up and just make a new project file?

0
Dan
Top achievements
Rank 1
Veteran
answered on 01 Feb 2021, 03:39 PM
My bet was wrong. A fresh project still will not render a grid with edit capabilities enabled. The HTML just is missing if inspected in dev tools. Like half the document was just deleted.
0
Anton Mironov
Telerik team
answered on 04 Feb 2021, 12:16 PM

Hello Dan,

Could you please send me back in this thread the newly created project. Examining this project will let us replicate the issue locally and further troubleshoot it.

A possible reason for the issue with opening my project is that its target framework is .NET 5.0

Looking forward to hearing back from you.

Once I have your sample project, I will try my best to resolve this one quickly for you.

 

Best Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Dan
Top achievements
Rank 1
Veteran
answered on 08 Feb 2021, 07:39 PM

Anton,

I figured this issue out. I didnt realize (should have) that when using the edit capability you need to make sure your model has a parameter less constructor. Mine had an overridden constructor but I did not explicitly declare a parameter less one so I assume it was erroring somewhere along the line. I did not receive any error from Telerik though so I had to dig to find this.

 

Thanks

0
Anton Mironov
Telerik team
answered on 11 Feb 2021, 09:51 AM

Hello Dan,

Thank you for sharing with the community the fix for this case.

This is a tricky one and could not be handled without the project available locally.

Thank you again. If further assistance is needed, do not hesitate to contact me and the team.

 

Greetings,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Veteran
Answers by
Anton Mironov
Telerik team
Dan
Top achievements
Rank 1
Veteran
Share this question
or