This is a migrated thread and some comments may be shown as answers.

Undo record delete in Grid

1 Answer 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MarNar
Top achievements
Rank 1
MarNar asked on 26 Feb 2013, 11:13 AM
Hi,

I'm using a Kendo grid with MVC. The grid is in batch editing mode using Open Access.
One of the requirements is the possibility to undo an accidental row delete while editing. The delete confirmation is not enough.
When a user edits a lot of rows and accidentally deletes a row, the only option is to cancel the changes. However all changes in the grid are rolled back. 

I have implemented a simple undo by hiding the row in the grid and saving the dataitem in a javascript queue.In a SaveChanges event I pop the remaining items on the undo queue and programmatically delete the items.

However if the user changes the filter options of the grid the 'hidden' deleted rows become visible again as the filtering options also hides and unhides rows.

Anyone have an idea for implementing a row undo that survives filtering and sorting ?

Regards,
Marcel

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 Feb 2013, 10:02 AM
Hello Marcel,

You should use the Grid dataBound event to hide the rows again because the table rows will be redrawn. If you are deleting the rows with custom request you could also send the IDs as additional data to the server and filter the collection.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
MarNar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or