Edit this page

Cancel Changes Per Row by Using the Incell Editing Mode of the Grid

Environment

Product Progress Kendo UI Grid
Operating System Windows 10 64bit
Browser Google Chrome
Browser Version 58.0.3029.110

Description

I use a Grid with a remote Datasource with the batch:true setup. The Grid is in the incell editing mode. The toolbar of the Grid has the create, save, and cancel commands. The problem is that the cancel command discards all made changes.

In other words, I need my Grid to have both of the following commands:
1. The cancel command of the row which discards only the changes of the corresponding row, and
1. The cancel command of the toolbar which discards all changes that are made.

How can I provide a cancel command per row and at the same time keep the above configurations?

Suggested Workarounds

The Kendo UI Grid does not provide a built-in solution for achieving this behavior. However, you can still work around this issue by applying custom logic.

  1. Add a custom button.
  2. On the button click, get the item by Uid.
  3. Call cancelChanges only for that item.

Important

This approach will prevent the item from being updated in the database. However, the old values will be visually reverted after saveChanges.

For more details, refer to the following articles:

To resolve the resulting scroll-related issue, restore the scroll position by using a custom approach. For a demo on how to implement this approach, refer to the modified version of the previously provided example.

Because of the usage of a custom approach, the event is expected to cancel the changes for a specific row. I hope the button click event or another event to be suitable as well for executing the custom logic.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy