Best way to detect changes in RadGrid in batch edit mode.

4 posts, 0 answers
  1. Sabrina
    Sabrina avatar
    1 posts
    Member since:
    Apr 2013

    Posted 07 May 2014 Link to this post

    Hello, 

    What is the best way to detect if my RadGrid in batch edit mode has had any of its cells modified and has pending unsaved changes?  I understand how to detect and handle the "batchEdit" command being fired to say the grid is up to date, but I am not sure how to detect on the client that a cell was modified.  This is my first time using a RadGrid so excuse my inexperience but I didn't see this question asked elsewhere.
  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1099 posts

    Posted 12 May 2014 Link to this post

    Hi Sabrina,

    One way to determine whether a cell in the grid had changed its value is to subscribe to the OnBatchEditCellValueChanged event and raise a flag which value you can later check. Another option is to construct a method which to check for changes in the table view using the _extractChangesString method.

    JavaScript:
    function hasChanges() {
               var grid = $find('<%=RadGrid1.ClientID%>'),
                   batchManager = grid.get_batchEditingManager();
               return (batchManager._extractChangesString(grid.get_masterTableView()) === "") ? false : true;
           }

    By following one of the above suggested approaches you should be able to verify whether the user has edited the data.

    Regards,
    Angel Petrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. gaurav
    gaurav avatar
    8 posts
    Member since:
    Jun 2019

    Posted 13 Aug Link to this post

    Hi, 

    How can the same functionality be achieved in WPF? I tried looking at the WPF forums but unfortunately couldn't find anything that implements the above mentioned functionality. Perhaps, if it exists, can you point me to the right page/thread?

  4. Rumen
    Admin
    Rumen avatar
    14034 posts

    Posted 13 Aug Link to this post

    Hi Gaurav,

    Please post your Telerik UI for WPF related questions at the WPF related forums. You can refer the link to this thread too.

    Thank you for your understanding. 

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top