Hello -
I had to change my Model to include two lists so i can bind it to two sets.
Now my model looks like:
My controller looks like
Errors:
Thanks.
I had to change my Model to include two lists so i can bind it to two sets.
Now my model looks like:
public class PaymentsViewModel
{
public List<
CorporateViewModel
> Corporations { get; set; }
public List<
PaymentViewModel
> Payments { get; set; }
}
public ActionResult Payments_Read([DataSourceRequest]DataSourceRequest request)
{
//get corps
//get payments
PaymentsViewModel returnObj = new PaymentsViewModel();
returnObj.Corporations = corps;
returnObj.Payments = payments;
DataSourceResult result = returnObj.ToDataSourceResult(request); <== returns error
return Json(result);
}
Errors:
- cannot convert from 'PaymentsViewModel' to 'System.Data.DataTable'
- 'PaymentsViewModel' does not contain a definition for 'ToDataSourceResult' and the best extension method overload 'Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(System.Data.DataTable, Kendo.Mvc.UI.DataSourceRequest)' has some invalid arguments
Thanks.