Solved

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

Posted on 2006-06-10
2
418 Views
Last Modified: 2008-02-01
Thanks. It looks simple.
0
Comment
Question by:maidinhtai
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
convert html to string 6 34
Web site error 3 41
Creating a route in asp.net webforms 2 26
Need to start a web service from Visual Studio 2015 Pro 2 24
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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