Determine if grid has changes, server side

5 posts, 0 answers
  1. Samuel
    Samuel avatar
    10 posts
    Member since:
    Jan 2009

    Posted 10 Feb 2009 Link to this post

    I'm developing sharepoint web parts using Telerik controls as a base. I have a web part that drops a Telerik RadGrid onto a page with data in it, and automatically sets all rows to be in edit mode server side before the web part is rendered. There is a button on the web part that the user clicks to save their data.

    When the data comes back, server-side, I need to determine if the user has actually made any changes, and if they have, which rows they have changed. My current method is to get all rows and compare their values to their "SavedOldValues." Is there a simpler, or more important, a more performant way to do this?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Feb 2009 Link to this post


    Here is a demo link that performs a similar functionality though the changes are being tracked on the client.
    The  global variable is set to true false  based on changes in the edit form controls

    Give it a try and let me know if this works for you.

  3. Peter
    Peter avatar
    98 posts
    Member since:
    Mar 2012

    Posted 13 Apr 2015 in reply to Princy Link to this post

    (This link is broken).
  4. Peter
    Peter avatar
    98 posts
    Member since:
    Mar 2012

    Posted 13 Apr 2015 in reply to Peter Link to this post

    I think this is it:

    Seems to work quite well with the new UserAction option (if you're not using Batch editing):

                function UserAction(sender, args) {

                    if (hasChanges && 
                        !confirm("Any changes will be lost. Are you sure?")) {

     I haven't un-set the value yet, but should be ok to run a "RegisterStartupScript" after clicking "Save Changes" button.

  5. Eyup
    Eyup avatar
    3322 posts

    Posted 16 Apr 2015 Link to this post

    Hi Peter,

    I'm glad you've managed to find out about the OnUserAction event and thank you for sharing your approach with our community. For other commands, you can also use the OnCommand event handler provided by RadGrid.


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top