This is a migrated thread and some comments may be shown as answers.

[Solved] passing the viewModel on update popup

0 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
william
Top achievements
Rank 1
william asked on 14 Jul 2011, 09:50 AM
Hi All,

Following the Telerik Example for updating a grid on popup I have the following set for my binding;
.DataKeys(keys => keys.Add(r => r.Id))
      .DataBinding(dataBinding =>
      {
          dataBinding.Ajax()
                    .Update("_SaveAjaxEditing", "Grid");
      })

Now back in the controller If I have:

[AcceptVerbs(HttpVerbs.Post)]
        [GridAction]
        public ActionResult _SaveAjaxEditing(int id)
        {......

When I press my update button the Id of the record in the popup is passed correctly to my controller. However, at this time I do not want to make an actual update. I only want to update the viewmodel. So What I really want in my post action is:

[AcceptVerbs(HttpVerbs.Post)]
        [GridAction]
        public ActionResult _SaveAjaxEditing(ComputerBreakdownRiskViewModel viewModel,int id)
        {.....

So, back in my bindings, How do I force the current view to be passed as well as the ID? I also want to obtain all the details from the popup.
Tags
Grid
Asked by
william
Top achievements
Rank 1
Share this question
or