title: Kendo MVC fire Create method on Update call
body: <p>I am using Kendo UI Grid with MVC 4 and it works great with only one exception.</p>
  
  <p>If I add a row in the grid, and after that update a row, It end up adding a row rather than updating it.</p>
  
  <p>What I can tell is that if I press add, the program enters the <em>Create</em> method in my MVC Controller, if I press Update on a row <strong>after</strong> the add I enter the <em>Create</em> method yet again. </p>
  
  <p>This, However, does not seem to be the case if I just press the update button in the grid directly after start up. I am doing all this with Ajax calls so it has something to do with the page not updating between calls. Everything works great if I just do one command then refresh the page. Also I am using Entity Framework as ORM.</p>
  
  <p><strong>This is my razor-view:</strong></p>
  
  <pre><code>@model IEnumerable&lt;Internal.License.Management.Web.UI.Models.PriceListViewModel&gt;
  
  @{
     ViewBag.Title = "Price List";
  }
  
  @(Html.Kendo().Grid&lt;Internal.License.Management.Web.UI.Models.PriceListViewModel&gt;()
  .Name("grid")
  .Columns(columns =&gt;
      {
          columns.Bound(p =&gt; p.Name).Width(120);
          columns.Bound(p =&gt; p.Code).Width(180);
          columns.Bound(p =&gt; p.Interval).Width(180);
          columns.Bound(p =&gt; p.PricePerUnit).Width(200);
          columns.Bound(p =&gt; p.Currency).Width(120);
          columns.Command(commands =&gt;
              {
                  commands.Edit();
                  commands.Destroy();
              }).Width(172);
      })
  .ToolBar(toolbar =&gt; toolbar.Create())
  .Editable(editable =&gt; editable.Mode(GridEditMode.InLine))
  .Pageable()
  .Sortable()
  .Scrollable()
  .HtmlAttributes(new { style = "height:430px;" })
  .DataSource(dataSource =&gt;
      dataSource.Ajax()
      .PageSize(20)
      .Events(events =&gt; events.Error("error_handler"))
      .Model(model =&gt; model.Id(p =&gt; p.Id))
      .Create(create =&gt; create.Action("Create", "PriceList"))
          .Read(read =&gt; read.Action("Read", "PriceList"))
          .Update(update =&gt; update.Action("Update", "PriceList"))
          .Destroy(destroy =&gt; destroy.Action("Delete", "PriceList"))
    ))
  </code></pre>
  
  <p><strong>This is my controller:</strong></p>
  
  <pre><code>public class PriceListController : Controller
  {
      public ActionResult List()
      {
          return View("PriceList");
      }
  
      public ActionResult Read([DataSourceRequest] DataSourceRequest request)
      {
          var model = new DataAdapter().GetAllOptionTemplates();
          var result = model.ToDataSourceResult(request);
  
          return Json(result);
      }
  
      [HttpPost]
      public ActionResult Create([DataSourceRequest] DataSourceRequest request,  
                             PriceListViewModel model)
      {
          if (model != null &amp;&amp; ModelState.IsValid)
          {
             new DataAdapter().SaveToDatabase(model);
          }
  
          return Json(new[] { model }.ToDataSourceResult(request, ModelState));
      }
  
      [HttpPost]
      public ActionResult Update([DataSourceRequest] DataSourceRequest request,   
                             PriceListViewModel model)
      {
          if (model != null &amp;&amp; ModelState.IsValid)
          {
             new DataAdapter().UpdateToDatabase(model);
          }
  
          return Json(ModelState.ToDataSourceResult());
      } 
  }
  </code></pre>
  
  <p><strong>This is my view model</strong></p>
  
  <pre><code>public class PriceListViewModel
  {
      public int Id { get; set; }
      public string Currency { get; set; }
      [DisplayName("Option Name")]
      public string Name { get; set; }
      public string Code { get; set; }
      public string Interval { get; set; }
      public decimal PricePerUnit { get; set; }
  }
  </code></pre>