473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

total pages

hey all,
i have a gridview of records and i'm trying to display the total pages with
10 records per page.

int totalpages;
totalpages = 1148 / 10;
totalpages = 114;

there's actually 115 total pages. how can i make sure i don't miss that last
page?

thanks,
rodchar
Jun 30 '07 #1
4 1897
On Jun 30, 3:04 pm, rodchar <rodc...@discussions.microsoft.comwrote:
hey all,
i have a gridview of records and i'm trying to display the total pages with
10 records per page.

int totalpages;
totalpages = 1148 / 10;
totalpages = 114;

there's actually 115 total pages. how can i make sure i don't miss that last
page?

thanks,
rodchar
why not just put pagesize=10 gridview will automatically handle it

nahid

KAZ Software
http://www.kaz.com.bd
blog http://nahidulkibria.blogspot.com

Jun 30 '07 #2
On Jun 30, 11:04 am, rodchar <rodc...@discussions.microsoft.com>
wrote:
hey all,
i have a gridview of records and i'm trying to display the total pages with
10 records per page.

int totalpages;
totalpages = 1148 / 10;
totalpages = 114;

there's actually 115 total pages. how can i make sure i don't miss that last
page?

thanks,
rodchar
totalpages = total / pageSize;
if (((float)total / pageSize) totalpages) totalpages += 1;

Jun 30 '07 #3
Howdy,

TotalPages = ((RowCount - 1) / PageSize) + 1;

Hope this helps
--
Milosz
"rodchar" wrote:
hey all,
i have a gridview of records and i'm trying to display the total pages with
10 records per page.

int totalpages;
totalpages = 1148 / 10;
totalpages = 114;

there's actually 115 total pages. how can i make sure i don't miss that last
page?

thanks,
rodchar
Jun 30 '07 #4
thank you everyone for the help.
rod.

"rodchar" wrote:
hey all,
i have a gridview of records and i'm trying to display the total pages with
10 records per page.

int totalpages;
totalpages = 1148 / 10;
totalpages = 114;

there's actually 115 total pages. how can i make sure i don't miss that last
page?

thanks,
rodchar
Jun 30 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mystery | last post by:
Can anyone point me to a script that will allow me to list x number of records per page and give me a page selector and information like the one in the subject header? Thanks.
0
by: krystoffff | last post by:
Hi I would like to paginate the results of a query on several pages. So I use a query with a limit X offset Y to display X results on a page, ok. But for the first page, I need to run the...
2
by: L Mehl | last post by:
Different users of the app will want or not want to see report footer ( appears as a separate page). I can make the section invisible with a DLookup of a Y or N value from a 'parameters' table ...
1
by: paulsmith5 | last post by:
Hi, Given that I have an two integers - firstly the total number of items and secondly the number of items per page what is the syntax to give me the total number of pages. For example if there...
3
by: Amelyan | last post by:
I need to get the total number of items/records returned into GridView. If I just do myGridView.Rows.Count, then it just returns me the total number of items on the page. But if I have, 10...
1
by: fbouabcha | last post by:
Hi, My pb is to know the total pages to print, because I want to print each pages this format "page n of M". Thanks. Nass
7
by: strsury | last post by:
Hi all, I have a page with 5 or 6 drop down boxes, all ranging from 1 to 100. After each is selected, I need a box that will show a total of all the results. So basically, dropdown 1 +...
1
by: tcertain | last post by:
I am totally duh at javascript although I have 2 books trying to learn it. I am trying to add values to a form and have a calculate total at end. this is my form script. I have hours at end of...
1
by: deshaipet | last post by:
Hi friends - I created a automatic storage tablespace with a pagesize of 16 K and initial size of 64 MB. create large tablespace test_tbsp1 pagesize 16k managed by automatic storage autoresize...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.