This is a migrated thread and some comments may be shown as answers.

[Solved] How to show No Records if totalPages = 0 with custom paging

0 Answers 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
A
Top achievements
Rank 1
A asked on 09 Jan 2012, 12:31 PM
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"

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

Tags
Grid
Asked by
A
Top achievements
Rank 1
Share this question
or