Detect number of rows on last page of gridview

P

Phil Johnson

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
 
D

David C

Phil,
Can't you just count them in Row Databound event? Then you could show that
count in a footer or ?

HTH
David
 
P

Phil Johnson

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/newsgroup...e50c&mid=a9062307-7386-453c-baf4-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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top