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

    Hi,

    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

    http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx

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

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. 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).
  5. 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: http://www.telerik.com/help/aspnet-ajax/grid-going-into-edit-mode-with-ajax-double-click.html

    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?")) {
                        args.set_cancel(true);
                    }
                }

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

  6. Eyup
    Admin
    Eyup avatar
    3014 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.

    Regards,
    Eyup
    Telerik
     

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

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017