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

Determine if grid has changes, server side

6 Answers 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Samuel
Top achievements
Rank 1
Samuel asked on 10 Feb 2009, 10:24 PM
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?

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Feb 2009, 12:04 PM
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
0
Peter
Top achievements
Rank 1
answered on 13 Apr 2015, 06:30 AM
(This link is broken).
0
Peter
Top achievements
Rank 1
answered on 13 Apr 2015, 06:42 AM

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.

0
Eyup
Telerik team
answered on 16 Apr 2015, 05:38 AM
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.

 
0
Pheath
Top achievements
Rank 1
answered on 08 Sep 2020, 01:26 PM

Can you provide an update to this link?

It does not seem to work.

Thank you,

Pheath Ram

0
Vessy
Telerik team
answered on 08 Sep 2020, 02:26 PM

Hi Pheath,

Here is the updated link to the target article:

https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/ajaxified-grid/go-into-edit-mode-with-ajax-double-click

Regards,
Vessy
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Grid
Asked by
Samuel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Peter
Top achievements
Rank 1
Eyup
Telerik team
Pheath
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or