This is a migrated thread and some comments may be shown as answers.
Kendo Grid inline Edit after need displayed sucessful message
3 Answers 176 Views
This is a migrated thread and some comments may be shown as answers.
Parthasarathi
Top achievements
Rank 1
Parthasarathi asked on 12 Dec 2012, 04:00 PM
Hi All,
           I am using inline edit in kendo grid with ForeignKey in my MVC3 Application. The record was updated successfully in database,but i want to displayed message like "The record was updated successfully" in my View. How to do that. Please share me if you have information about this.

Please find my edit Kendo grid Edit event


  [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult CommandParameterTypeUpdate([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<CommandParameterModel> commandParameters)
        {
          
           ///Update to database   
            return Json(ModelState.ToDataSourceResult());
        }

I want to displayed "The record was updated successfully" message in my view from this edit event.

Thanks
Parthasarathi M

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 14 Dec 2012, 10:00 AM
Hi Parthasarathi,

 
Basically you can use the RequestEnd event to check if the current event type is "Update" and the Errors property in the response is empty to display to notify the user that the "Update" is successful. Please check the example below:

Define DataSource RequestEnd handler:

.Events(e => e.RequestEnd("onRequestEnd"))

onRequestEnd function:
function onRequestEnd(e) {
    //Check request type
    if (e.type == "create" || e.type == "update") {
        //check for errors in the response
        if (e.response == null || e.response.Errors == null) {
            alert("success");
        }
    }
}
Kind regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kushan Shah
Top achievements
Rank 1
answered on 07 Sep 2018, 07:55 AM

Hi Support Team,

I am getting same issue. OnRequestEnd, I cant see the value set in TempData, ViewData or ViewBag.

Thanks

0
Viktor Tachev
Telerik team
answered on 11 Sep 2018, 08:03 AM
Hello Kushan,

The suggestion for handling requestEnd can be used to determine if the operation on the server was successful or not and show relevant message to the user. 

If you would like to use values stored in ViewData I can suggest the approach described in the following stackoverflow thread. 


With that said, please submit each new query in a separate ticket or post. This way the information in a given thread will be consistent and easier to use as reference in the future. 

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.
Tags
Grid
Asked by
Parthasarathi
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Kushan Shah
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or