By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,805 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,805 IT Pros & Developers. It's quick & easy.

number of rows in a gridview with pagesize?

P: n/a
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
Mar 1 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I found it:
Protected Sub SqlDataSource2_Selected(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceStatusEvent Args) Handles
SqlDataSource2.Selected
e.AffectedRows
Mar 1 '08 #2

P: n/a
Thanks for following yourself up Vincent because if you hadn't I'd still be
looking for an answer to the same question. Mike

"Vincent" wrote:
I found it:
Protected Sub SqlDataSource2_Selected(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceStatusEvent Args) Handles
SqlDataSource2.Selected
e.AffectedRows
Mar 10 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.