Solved

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

Posted on 2006-06-10
2
432 Views
Last Modified: 2008-02-01
Thanks. It looks simple.
0
Comment
Question by:maidinhtai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
SystemExpert earned 250 total points
ID: 16877572
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
 
LVL 3

Author Comment

by:maidinhtai
ID: 16877779
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
c#, datatable, aspx 4 53
aspx ascx, c# 7 45
jquery autocomplete forcing the user to select an item from the list 7 63
dropdownlist in asp.net vb. 3 24
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question