Fixing Telerik ASP.NET Core Kendo grid problem with data not showing
I have a .NET 8 MVC app using Telerik UI for ASP.NET Core. I was able to follow their tutorial to install everything smoothly. The datepicker component worked fine.
But, when I went to use the grid component, the data wouldn't appear. I tried a couple of their examples and stripped my own grid down to bare-bones, but still had the issue. I could debug and see that the data was being sent. I was trying to figure out how to log the data received from the client, but had no luck. I still want to know how to console.log()
the datasource result and will make a post when I figure it out.
I ended up finding a solution on Stack Overflow. All I had to do was add this options setting in my Program.cs. I had the .AddControllersWithViews
call and just chained on .AddNewtonsoftJson()
with the options arrow function.

From what I've gathered, this serializes the JSON into PascalCase, rather than .NET's default of camelCase. You can read about it here in the Telerik docs. But, the solution there didn't work for me, I believe because I needed the Newtonsoft settings changed.