This question is locked. New answers and comments are not allowed.
Hi,
I am using telerik grid with custom paging. Below shown is my code in my telerik grid. When I get Totalpages = 0, then I am getting the error at .Pageable(paging => paging.Total(TotalPages).PageTo(currentPage)) showing that AurgumentOutOfRange Exception: "page" cannot be negative or zero. Parameter name: page"
I am using telerik grid with custom paging. Below shown is my code in my telerik grid. When I get Totalpages = 0, then I am getting the error at .Pageable(paging => paging.Total(TotalPages).PageTo(currentPage)) showing that AurgumentOutOfRange Exception: "page" cannot be negative or zero. Parameter name: page"
var
currentPage = (int)ViewData["currentPage"];
var TotalPages = (int)ViewData["TotalPages"];
currentPage =
Math.Max(currentPage, 1);
currentPage =
Math.Min(TotalPages, currentPage);
.NoRecordsTemplate(
"No Records found.")
.Pageable(paging => paging.Total(TotalPages).PageTo(currentPage))
Thanks