473,385 Members | 1,521 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,385 software developers and data experts.

Detect number of rows on last page of gridview

Hi,

I have a gridview with paging enabled.

I need to know how many rows of data are on the last page!!!

When I look at the Gridview1.Rows.Count in the Page_Load, it always returns
the number that the paging is set to... currently 13, but if there are only 4
rows on the last page, I need to know that there are only 4 rows.

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com
Mar 18 '08 #1
2 3080
Phil,
Can't you just count them in Row Databound event? Then you could show that
count in a footer or ?

HTH
David
"Phil Johnson" <Ph*********@discussions.microsoft.comwrote in message
news:FE**********************************@microsof t.com...
Hi,

I have a gridview with paging enabled.

I need to know how many rows of data are on the last page!!!

When I look at the Gridview1.Rows.Count in the Page_Load, it always
returns
the number that the paging is set to... currently 13, but if there are
only 4
rows on the last page, I need to know that there are only 4 rows.

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com

Mar 18 '08 #2
Ah, thanks for that David, that would work.

I was trying to resolve a row sizing issue in Opera I'm having and thought
about setting the grid height, then changing the height on the last page to
size the rows correctly. The last page height would depend on the number of
rows.

http://msdn.microsoft.com/newsgroups...4-78a8afb5e50c

I have resolved the issue with another 'hack', but your response would work
to get the number of rows in the last page.

Thanks,

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com
"David C" wrote:
Phil,
Can't you just count them in Row Databound event? Then you could show that
count in a footer or ?

HTH
David
"Phil Johnson" <Ph*********@discussions.microsoft.comwrote in message
news:FE**********************************@microsof t.com...
Hi,

I have a gridview with paging enabled.

I need to know how many rows of data are on the last page!!!

When I look at the Gridview1.Rows.Count in the Page_Load, it always
returns
the number that the paging is set to... currently 13, but if there are
only 4
rows on the last page, I need to know that there are only 4 rows.

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com


Mar 19 '08 #3

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

Similar topics

2
by: Flinky Wisty Pomm | last post by:
Hi all, I've got a really annoying problem that I need to fix sharpish. I've got a GridView derived control which has a templated header and footer. It works wonderfully on the first render but...
4
by: c676228 | last post by:
Hi everyone, I need to write a insruance program which needs to collect multiple people information, The information for each person includes name, email, address, phone, dob etc. The DOB data...
3
by: tsedward | last post by:
I am creating a databound gridview. The last cell of each row can, and usually does, contain a lot of text. Is there any way that I could drop this last cell down into the next line on the...
0
by: takallen | last post by:
Hello, I am designing a web page that is to be used as a data entry form. Each row on the page contains 50 columns, and the user needs to be able to input about 25 rows on each page. To...
1
dotneto
by: dotneto | last post by:
Hi, I'm working on a gridview with an object datasource. I send the sort expression and sort order to the selecting method through a parameter. It works fine in the ascending order, but in the...
0
by: ganesh22 | last post by:
Hi... Iam using GridView in asp.net(2.0) .My requirement is user can add,update,delete in gridview I written the code for add & update but can u help adding rows in grid view My code: ...
2
by: tomh2099 | last post by:
Hi, Hi, I have an ASP.NET 2005 application (using VB) with a GridView control that needs to have the last 5 or 6 rows in Bold or maybe some other special formatting. Most of the rows show...
1
by: zlf | last post by:
For tables with large number of rows, it is difficult to access the rows with high page number due to high volume of data. Currently the user is required to click the "..." link many times to get...
1
by: COHENMARVIN | last post by:
I have a gridview and I need to know the number of rows in it. I find the Page_load and the Gridview_Load events are too early to find out the number of rows. I can use the Gridview_databound...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.