473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

number of rows in a gridview with pagesize?

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
2 5507
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ken | last post by:
Hi All - I have a filtered GridView. This GridView has a check box in the first column. This check box is used to identify specific rows for delete operations. On the button click event I...
10
by: NH | last post by:
I have a girdview with paging enabled. How can I add a message in the footer to say "Viewing records 1-15 of 45" etc Thanks
3
by: John Daly | last post by:
I am using a Gridview to display a phone directory, with paging on. I have a link button that a user clicks to add a new record, which reloads the page, sets the visble property to false on the...
4
by: Adam Sandler | last post by:
Hello, Using VWD 2005 here and I want to set the GridView PageSize at runtime. This URL has an example of what I exactly want to do......
2
by: Oystein | last post by:
Hi! I've got a DropDownlist with predefined numbers(5,10,15,20 etc.) which I want to do a postback to the GridView pagesize, so that the user manually can change returned rows. Is there a way to...
4
by: Julian32 | last post by:
Hello all, I'm using a Gridview control with an Access database as the data source. I created a custom column (Template Field) and am trying to populate it with the row number. Please note that...
3
by: Nathan Sokalski | last post by:
I have a GridView control with three columns, all BoundField columns. They all have a HeaderText and DataField property set, and the third one has a DataFormatString property as well. When I run my...
1
by: COHENMARVIN | last post by:
I have a gridview and I need to know the number of rows in it. I find the Page_load and the Gridview_Load events are too early to find out the number of rows. I can use the Gridview_databound...
3
by: anjali5 | last post by:
Hello Everyone, I want to display an image in my gridview. The only thing is my datatabse table is returning true if there is an image and false if there is no image and I am binding my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.