My issue involved using Entity Framework / Kendo Grid and Web API 2 controllers and no ASP.NET MVC / Razor. All my code is either C# in controllers or straight up HTML / JavaScript.
It would appear that Kendo Grid are more geared for using tables / views directly rather than using stored procedures, am I correct in this assessment, or not?
I am trying to use one stored procedure in EF with a custom action name to return an IEnumerable
and it populates the grid just fine, but when I try to hit the 'save changes' button, it attempts to do a POST and a PUT (I actually do think it's doing a POST because one of the rows does not have a primary key defined).
I should also mention that I think the model is not entirely the same, as the fields that get returned in the grid, don't necessarily correlate 1:1 with what gets fired in my save/update procedure. I have more fields being returned to me in the GET, and I have the model specified in the kendoDataSource, but can I customize and pick out what's being sent back when I click save changes?
During debugging, I see the correct lines in the network inspector show up, but when I look in the POST method that its hitting in the Web API 2 Controller I can't even see any values when I hover over the object being returned - which could be another issue.
So at the core, my questions are...
Is it possible to have one model return values in a GET procedure to the kendo grid, and have an entirely different model get returned in the PUT/POST procedures on this grid, during batch save? It really seems that Kendo Grids prefer using tables directly, or views, but it's policy that I can't be touching tables at all, and we prefer not to use views, we prefer to go entirely stored procedures.
Does the kendo grid, when doing a batch update/save, even though it says it's batch, is it ultimately sending data over per row, so one at a time? Or is it literally sending data over as one batch?
We're using the grids to retrieve dynamic data, the rows will not be fixed, I've worked with templates a little to add CSS classes to the elements that wrap the cells, but that won't be flexible enough, but in saying that, I wonder if there's a way to yank the data out of the grid, and throw it into some hidden table or values on the front end and have a separate save button out of scope of the grid itself, to do a save of the user's newly typed in values...?
Thank you in advance