I had a strange problem in Kendo grid, when a the last row was canceled the values of the first row were shown in the last row.

The first fix was adding a cancel even handler:

cancel: function (e) {
                     this.cancelChanges();
                 }

This fixed the bug, but introduced an other one.

Now rows would persist the canceled values.

To fix both problem I changed the event handler to:

cancel: function (e) {
      this.cancelChanges();
}

I used kendo 2017.1.118

4 Comments

  1. I had a similar issue with the MVC Grid. If a user selected the edit button and canceled. The line data would be replaced by the data of the first record. If the user left the page or refreshed, the grid would clear up. However, if the user did not notice and selected edit again the underlying data would then be changed. In our case we were using 4 columns as the primary key. The control would get confused. Because I had no control over the database structure I created a View Model with a string ID. Then in the Grid Read method I concatenated those 4 columns into a single Primary Key for each record. This resolved the issue with the control. However, in the update or delete methods I had to re-query the original record using the 4 columns, make changes to the original record and save. It works without issue but is ugly to say the least. Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.