I am using a Kendo grid in Batch Edit Mode. When I add rows to the grid and click Save Changes, the added rows correctly get passed to the Create method that I have hooked up, and I am able to add the rows to the database. The problem I have is that when I then edit one of those newly-added rows and click Save Changes, these rows get passed to the Create method (again) instead of being passed to the Update method.
Please advise asap as to what I am doing wrong. Here is my Create Method that is hooked up to the grid.
Please advise asap as to what I am doing wrong. Here is my Create Method that is hooked up to the grid.
[HttpPost]
public ActionResult Create( [DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]FormCollection addedRoles) {
try { // code here to update the database from the addedRoles FormCollection. This part works fine. ModelState.Clear() // I added this in to see if it makes a difference...it does not. }catch (Exception ex) {
ModelState.AddModelError("", ex.Message);
}
return Json(ModelState.ToDataSourceResult());
}