Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Detect number of rows on last page of gridview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Johnson - 18 Mar 2008 21:31 GMT
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.

Signature

Regards,

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

David C - 18 Mar 2008 21:54 GMT
Phil,
Can't you just count them in Row Databound event?  Then you could show that
count in a footer or ?

HTH
David
> Hi,
>
[quoted text clipped - 7 lines]
> only 4
> rows on the last page, I need to know that there are only 4 rows.
Phil Johnson - 19 Mar 2008 10:23 GMT
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/managed/default.aspx?&guid=&sloc=en-us&dg=m
icrosoft.public.dotnet.framework.aspnet&p=1&tid=a9062307-7386-453c-baf4-78a8afb5
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,

Signature

Regards,

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

> Phil,
> Can't you just count them in Row Databound event?  Then you could show that
[quoted text clipped - 13 lines]
> > only 4
> > rows on the last page, I need to know that there are only 4 rows.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.