Link to home
Start Free TrialLog in
Avatar of maidinhtai
maidinhtai

asked on

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

Thanks. It looks simple.
ASKER CERTIFIED SOLUTION
Avatar of SystemExpert
SystemExpert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maidinhtai
maidinhtai

ASKER

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.