public ActionResult BatchEditingUpdateModelPerson(MVCxGridViewBatchUpdateValues <Person, int> batchValues)
        {
            foreach (var person in batchValues.Update)
            {
                if (batchValues.IsValid(person))
                {
                    PersonsList.UpdatePerson(person);
                }
                else
                {
                    batchValues.SetErrorText(person, "Correct validation errors");
                }
            }

            foreach (var person in batchValues.Insert)
            {
                if (batchValues.IsValid(person))
                {
                    PersonsList.AddPerson(person);
                }
                else
                {
                    batchValues.SetErrorText(person, "Correct validation errors");
                }
            }

            foreach (var personID in batchValues.DeleteKeys)
            {
                PersonsList.DeletePerson(personID);
            }
            return(PartialView("GridViewPartial", PersonsList.GetPersons()));
        }
 public ActionResult EditingDelete(int personId)
 {
     list.DeletePerson(personId);
     return(PartialView("GridViewTemplatePartial", list.GetPersons()));
 }
コード例 #3
0
 public ActionResult EditingDelete([ModelBinder(typeof(DevExpressEditorsBinder))] int personId)
 {
     list.DeletePerson(personId);
     return(PartialView("GridViewPartial", list.GetPersons()));
 }