I am trying to use the packaged PagedList.MVC
to try and force my data into splitting into pages. However I get so far in the controller and then receive the above error and another error is given below:
The best overloaded method match for 'PagedList.PagedList.PagedList(System.Collections.Generic.IEnumerable<ViewModel>, int, int)' has some invalid arguments
But, I think this error will be fixed once my first error is solved.
Can anybody help me with the problem?
Controller:
public ActionResult SupplierReportSelection(int ClientID, int? SupplierID = null, int? ReviewPeriodID = null, int page = 1)
{
ClaimsBySupplierViewModel SupplierModel = ClaimsBySupplier(ClientID, SupplierID, ReviewPeriodID);
int pageSize = 10;
int pageNumber = (page);
PagedList<ClaimsBySupplierViewModel> model = new PagedList<ClaimsBySupplierViewModel>(SupplierModel, page, pageSize);
ViewBag.client = client;
return View("ClaimsBySupplier", model);
}
ViewModel:
public class ClaimsBySupplierViewModel : ReportViewModel {
public IQueryable<ClaimsBySupplierReport> ReportData { get; set; }
public IQueryable<SupplierAndClaimNumberReviewTotalsByStatusCategory> ReportTotalData { get; set; }
public decimal? Conversion { get; set; }
}