number of rows in a gridview with pagesize?

V

Vincent

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
 
V

Vincent

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

Mike

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

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top