Undo Functionality in Grid

2 posts, 0 answers
  1. Jorge Gonzalez
    Jorge Gonzalez avatar
    58 posts
    Member since:
    Oct 2009

    Posted 21 Dec 2009 Link to this post

        I've implemented an undo capability into the grid. If a user changes the value of a field but they want to reverse the change they will click on the undo button and the change is undone. This undo functionality remembers only the last change. I've implemented this using List's and by clearing out the grid and re-building the grid using the data in the lists. It works but it's slow. Imagine re-building a 2000 row X 800 column grid. I tried saving the previous state of the data in the grid in another datatable and then getting rid of the current datatable and making this datatable the current one but I ran into many problems. Because rows and columns can be deleted the datatable rejectchanges() function is of no use.

    Any ideals would be appreciated.


  2. Tsvyatko
    Tsvyatko avatar
    858 posts

    Posted 23 Dec 2009 Link to this post

    Hi Jorge Gonzalez,

    In the attachment you will find simple example that demonstrates how how you can implement undo functionality without need to saving/restoring all the data you display rather than keeping track only on the particular changes that user had made.

    Hope this works for you.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top