This is a migrated thread and some comments may be shown as answers.
Aspnet Mvc/Helpers/Grid/Ajax-editing
2 Answers 26 Views
This is a migrated thread and some comments may be shown as answers.
Gusev
Top achievements
Rank 1
Gusev asked on 15 Mar 2013, 10:21 AM
Hello!
I have one questons!

I use help from 
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/listview/editing

and why if I use "public ActionResult Editing_Create"
 I need return 
return Json(new [] { product }.ToDataSourceResult(request, ModelState));
but if I use public ActionResult Editing_Update
I need return 
return Json(ModelState.ToDataSourceResult());

In my project,when I use 
return Json(ModelState.ToDataSourceResult());
for my Update Method...I get "ModelState.ToDataSourceResult = null", and if I use first example, I get what I need

Please help!
Give me please some explanation
And sorry for my bad English

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 18 Mar 2013, 10:38 AM
Hello Gusev,

 
When you create new items they must be returned back to client in order be accepted from the DataSource. This however is not required when you update items.

The ModelState in both cases must be returned as this is one of the indicators whether the server operations has succeeded or failed.

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ernesto
Top achievements
Rank 1
answered on 11 Apr 2013, 09:18 PM
Hellow Gusev,

I have been also struggling with this and I just found this links that might be useful to you (and all of us).

- http://www.kendoui.com/forums/mvc/grid/edit-problems-with-2013-1-319.aspx
- http://www.kendoui.com/forums/mvc/general-discussions/update-destroy-operations-trigger-the-error-event-of-the-datasource-after-updating-to-q1-2013-(v-2013-1-319).aspx
Tags
Grid
Asked by
Gusev
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Ernesto
Top achievements
Rank 1
Share this question
or