I'm trying to paginate a WebGrid using PagedList but a conversion error occurs:
Additional information: Can not implicitly convert type 'PagedList.PagedList' in 'System.Collections.Generic.List'
I do not know if it occurs because the variable dns
is of type List<dynamic>
as shown below:
ViewBag.Columns = columns;
var dns = new List<dynamic>();
dns = Util.DataTableParaDynamic.ConverterDtParaList(dt);
int paginaTamanho = 15;
int paginaNumero = (page);
ViewBag.Total = dns.ToPagedList(paginaNumero, paginaTamanho);
It is not necessary to use PagedList, I can use any other medium that pagination and works under these conditions.