I have a Kendo Grid (MVC) that has multiple Columns.
I have a use case where if Column 1 is edited, the value of Column 2 may change server-side. I'm not seeing the modified values in the grid though.
My Update API handles all of this and returns the updated row. But with inline editing, it seems that if I update Column 1, the other columns aren't refreshing after the Update is finished. So I (the user) has to manually refresh the Grid in order to see Column 2 correctly modified.
What am I doing wrong?
StackOverflow thread with same question: https://stackoverflow.com/q/47354235/590774
Feel free to answer anywhere.
5 Answers, 1 is accepted
In scenarios where the value in column 2 has to be changed after a change in column 1, the value in column 2 has to be changed on the server. Then the response from the server should contain the newly modified model with the new values for column 1 and 2.
For example, the Grid is sending value 10 for column 1, then on the Action in the controller to make a calculation based on that value 10 and set the column 2 value to the desired one.
I made a test scenario on my end and it was working as expected:
If additional assistance is needed on this matter please provide a runnable example and I will gladly provide a suggestion best suited for it.
Thank you for your reply.
A couple of questions.
1. Why did you use a POST instead of a PUT? Is that necessary?
2. I am using WebAPI controllers for the services, not MVC as in your example.
3. What does your Grid MVC layout code look like? Perhaps something is wrong with mine that I am not seeing.
I ask these questions because my service looks very similar to yours and it does not seem to be working correctly.
I am wondering what else factors into my issue.
Regarding the questions:
1) Using PUT instead of POST should not cause an issue if the WepAPI is reading the parameters correctly.
2) If a WebApi is used I can suggest checking the following resources and a runnable example:
3) The Grid layout is the same as in our demo which I used for reference:
This Put method is doing the following:
So the updated fields never get returned. Just an OK status goes back to the grid.
Your other example:
The EditingInine_Update method is doing the following:
That is not WebAPI but that really shouldn't matter.
In my code (WebAPI) I am using
This isn't working. Not updating the other columns in the Grid. Only the originally edited column (Column1).
What does it seem that I am doing wrong? Am I supposed to return an array? Am I supposed to use the DataSourceRequest in the WebAPI method?
Indeed for the update, only a status code is returned, but for Create and Delete the actual item is returned.
Please refer to the POST and DELETE methods for the syntax.
As if we may be missing a small detail, please provide a runnable example where I can test the scenario and provide a suggestion best suited for it.