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.

number of rows in a gridview with pagesize?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vincent - 01 Mar 2008 21:27 GMT
Hi,

i want to know the number of rows in a gridview bound to a sqldatasource.
I tried this:

Protected Sub grv_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles grv.DataBound
         Label1.Text = gridview1.Rows.Count
End Sub

and this:

Protected Sub grv_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles grv.RowDataBound
      Label1.Text = gridview1.Rows.Count
End Sub

There are 120 rows and the pagingsize=10.
This gives in both cases: 10 (=pagesize).

How can i get all rows (120)?
Thanks
Vincent
Vincent - 01 Mar 2008 21:58 GMT
I found it:
Protected Sub SqlDataSource2_Selected(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles
SqlDataSource2.Selected
e.AffectedRows
Mike - 10 Mar 2008 19:21 GMT
Thanks for following yourself up Vincent because if you hadn't I'd still be
looking for an answer to the same question.  Mike

> I found it:
> Protected Sub SqlDataSource2_Selected(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles
> SqlDataSource2.Selected
> e.AffectedRows

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.