Exemple #1
0
 public ActionResult ContextMenu(FormCollection form)
 {
     string[] selectedItems = ListBoxExtension.GetSelectedValues <string>("lbContextMenuItems");
     if (selectedItems != null)
     {
         ContextMenuItems.ForEach(i => i.Visible = false);
         Array.ForEach(selectedItems, i => ContextMenuItems[i].Visible = true);
     }
     return(ContextMenuCore(ContextMenuItems));
 }
        public ActionResult StudentGridViewPartialAddNew([ModelBinder(typeof(DevExpressEditorsBinder))] Models.Users item)
        {
            var model = new object[0];
            var keys  = ListBoxExtension.GetSelectedValues <string>("UserRoles");

            if (ModelState.IsValid)
            {
                try
                {
                    // Insert here a code to insert the new item in your model
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_StudentGridViewPartial", model));
        }