public ActionResult RequestQuestionGVPUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] MVCxGridViewBatchUpdateValues <RequestQuestionSenarioViewModel, int> updateValues, int Id)
        {
            ViewBag.Id = Id;
            RegisterRequestsDAL RR = new RegisterRequestsDAL(Id);

            ViewBag.Status = RR.RegisterRequests.RequestStatus.GetValueOrDefault();

            var model = RequestQuestionSenarioViewModel.GetRequestQuestionSenarioListByRegisterRequests_Id(Id);
            // Insert all added values.
            var newId = model.Count > 0 ? model.Max(i => i.Id) : 0;

            foreach (var item in updateValues.Insert)
            {
                try
                {
                    RequestQuestionSenarioViewModel RQS = new RequestQuestionSenarioViewModel();
                    RQS.Question_id         = item.Question_id;
                    RQS.RegisterRequests_Id = Id;
                    RQS.Create();
                    model.Add(RQS);
                }
                catch (Exception e)
                {
                    updateValues.SetErrorText(item, e.Message);
                }
            }
            // Update all edited values.
            foreach (var item in updateValues.Update)
            {
                try
                {
                    var modelItem = model.FirstOrDefault(it => it.Id == item.Id);
                    if (modelItem != null)
                    {
                        item.Update();
                    }
                }
                catch (Exception e)
                {
                    updateValues.SetErrorText(item, e.Message);
                }
            }
            // Delete all values that were deleted on the client side from the data source.
            foreach (var ItemID in updateValues.DeleteKeys)
            {
                try
                {
                    var item = model.FirstOrDefault(it => it.Id == Convert.ToInt32(ItemID));
                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                catch (Exception e)
                {
                    updateValues.SetErrorText(ItemID, e.Message);
                }
            }

            return(PartialView("_RequestQuestionGVP", model));
        }