Пример #1
0
        public ActionResult GridView1PartialUpdate(GridViewBatchEdit.Models.SampleModel item)
        {
            var model = new object[0];

            if (ModelState.IsValid)
            {
                try
                {
                    SampleModelList.UpdateItem(item);
                    // Insert here a code to update the item in your model
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_GridView1Partial", SampleModelList.GetData()));
        }
Пример #2
0
 public static void AddItem(SampleModel postedItem)
 {
     SampleModelList.GetData().Add(postedItem);
 }