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

Can I set a "Save successful" message after batch update?

3 Answers 535 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alison
Top achievements
Rank 1
Alison asked on 01 Aug 2012, 10:40 PM

Hi all

After clicking the "Save Changes" button when batch editing a grid, I'd like to set a message once the data has been updated. Currently, the only visual clue that it's been successful is that the little red "triangles" disappear next to the edited entries. My users need something a little less subtle :).

I see there is an event :

saveChanges

Fires before the grid calls DataSource sync.

However, is there an event after the DataSource sync is successful?

I've tried placing a success function in the dataSource's transport: update but it never seems to get hit. Also done a lot of searching but can't find any suggestions.

update: {
    url: "sEMM.asmx/updateEMMData", //specify the URL from which should update the records.
    contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
    type: "POST", //use HTTP POST request as the default GET is not allowed for ASMX
    success: function (result) {
        alert("success");
        setMessage("Changes saved");
        options.success(result);
    },
    error: function (e) {
        alert('error');
    }
}

Thanks, Alison

3 Answers, 1 is accepted

Sort by
0
Alison
Top achievements
Rank 1
answered on 02 Aug 2012, 10:45 PM
See forum post http://www.kendoui.com/forums/ui/grid/progress-during-savechanges.aspx

Not sure if it could handle an error message but does what I need for now :).
0
Renu
Top achievements
Rank 1
answered on 15 Nov 2018, 08:32 AM
Any solutions from Telerik Team??
0
Viktor Tachev
Telerik team
answered on 19 Nov 2018, 02:16 PM
Hello,


In order to inform the user that an operation has finished you can use the DataSource requestEnd event. Have in mind that this event does not contain any information about errors that may have occurred. Thus, I would suggest to also handle the error event that will be raised if there are any errors returned from the server.


Regards,
Viktor Tachev
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.
Preline
Top achievements
Rank 1
commented on 29 Sep 2021, 06:44 AM

Hi Viktor

Just wanted to check if there is a way to do something similar to this in Telerik Ui for asp.net Ajax?

I have a normal RadGrid and after saving or adding a new record I want to display a success message, is this possible? Can you assist?

Doncho
Telerik team
commented on 01 Oct 2021, 08:13 AM

Hi Preline,

With RadGrid for ASP.NET AJAX, you can use the following three events to ensure the success of the respective operation and notify the user in the desired manner:

All the listed events expose event arguments related to eventual exception occurred during the data source operation:

  • (Exception) e.Exception - Gets the exception related to the operation. The property value will be 'null' if no exception occurred during the operation.
  • (bool) e.ExceptionHandled - Gets or sets a value which if set to 'true' and exception was thrown will cause the RadGrid to skip throwing the exception and will let the user handle it.

Sample implementations of notifying the user for the result of data source operation you can find here:

In case this information is not enough, or you have any further questions, please raise them in a new thread in the Telerik UI for ASP.NET AJAX forum

Regards,
Doncho

Tags
Grid
Asked by
Alison
Top achievements
Rank 1
Answers by
Alison
Top achievements
Rank 1
Renu
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or