@(Html.EJ().Grid<object>("Grid") .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource).UpdateURL("/Home/Update").InsertURL("/Home/Insert").RemoveURL("/Home/Delete").Adaptor(AdaptorType.RemoteSaveAdaptor)) -------------------------------------- .Columns(column => { ------------------------ })) -------------------------------------------------------------- public ActionResult Update(Employee value) { simpledbEntities1 context = new simpledbEntities1(); Employee table = context.Employees.Single(v => v.EmployeeID == value.EmployeeID); context.Entry(table).CurrentValues.SetValues(value); context.Entry(table).State = EntityState.Modified; context.SaveChanges(); return Json(value, JsonRequestBehavior.AllowGet); } |