Aspnet Mvc/Helpers/Grid/Ajax-editing

3 posts, 0 answers
  1. Gusev
    Gusev avatar
    83 posts
    Member since:
    Dec 2012

    Posted 15 Mar 2013 Link to this post

    I have one questons!

    I use help from

    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. Nikolay Rusev
    Nikolay Rusev avatar
    2289 posts

    Posted 18 Mar 2013 Link to this post

    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.

    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!
  3. Ernesto
    Ernesto avatar
    2 posts
    Member since:
    Sep 2012

    Posted 11 Apr 2013 Link to this post

    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).

Back to Top