I have a grid control that I have bound to a model of IEnumerable. How ever in my controller I would like to save a record. The grid control I am using is one from Telerik 'Kendo'. The request back is a string and I would like to get my bound object 'CustomerViewModel' how ever when I pass in my object it comes back null. I have tried different types of information and it seems to only work for i specify the property I would like to pass in. Please find code below and assist?
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Save([DataSourceRequest] DataSourceRequest request, CustomerViewModel customerViewModel)
{
if (customerViewModel != null && ModelState.IsValid)
{
var customers = Repository.GetItems<Customer>();
Repository.SaveChanges<Customer, CustomerViewModel, NorthWindDataContext>(customers, customerViewModel);
}
return Json(ModelState.ToDataSourceResult());
}