Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

How to know the pageindex of the last page of a gridview

Thanks. It looks simple.
0
maidinhtai
Asked:
maidinhtai
1 Solution
 
SystemExpertCommented:
Hi,

You may have page size

and number of record

so

 Page size / number of record  = you will get how many paging page you have

and last pageindex =  -number of record - (pagesize * number of page )

thanks

0
 
maidinhtaiAuthor Commented:
Simply it's gridview1.PageCount-1. And I found the problem is at the Page_Load event and Page_SaveStateComplete event. gridview1.PageCount always returns 0 in Page_Load event and it returns a number >= 0 in Page_SaveStateComplete event. That's why I always get a error.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now