473,387 Members | 1,517 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,387 software developers and data experts.

How to count total number of rows in the datagrid.

I found the following to count the total number of VISIBLE rows of datagrid

datagrid.visiblerowcount

How do we count the total number of ACTUAL (not just visible) rows of
datagrid?

Thanks in advance.
Nov 21 '05 #1
2 11094
Actual, I did not see a method or property to use for, but as a datagrid
always has a datasource behind, just ask for the number of rows in your
datatable, dataview or whatever you use as datasource - it will give you the
total number of rows...

Daniel

"patang" wrote:
I found the following to count the total number of VISIBLE rows of datagrid

datagrid.visiblerowcount

How do we count the total number of ACTUAL (not just visible) rows of
datagrid?

Thanks in advance.

Nov 21 '05 #2
In my code, I am connecting to the datasource and after the data is copied to
the datagrid I am closing the connection.

DataGrid1.DataSource = ds.Tables("Employee")

Now I want to SUM the values of a particular column in the datagrid. So I
was thinking If I know the total number of rows in the datagrid, I could have
added the values of all the rows by running a loop or something...

Could you please tell me the right direction

"Daniel Ch. Bloch" wrote:
Actual, I did not see a method or property to use for, but as a datagrid
always has a datasource behind, just ask for the number of rows in your
datatable, dataview or whatever you use as datasource - it will give you the
total number of rows...

Daniel

"patang" wrote:
I found the following to count the total number of VISIBLE rows of datagrid

datagrid.visiblerowcount

How do we count the total number of ACTUAL (not just visible) rows of
datagrid?

Thanks in advance.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
2
by: DC Gringo | last post by:
I have a datagrid control that has paging set up and working. What I would like is a total record count (not just per page) in the header or near the header of the datagrid. Here's my code: ...
2
by: arno | last post by:
Hello, With a datagrid (asp.net 2), how do I do to have a query's total. When I use GridView1.rows.count, I had the total for a page but not for all pages. (I don't wish to use a second query :...
6
by: jason | last post by:
hello everyone, one of my developers is working with a DataGrid component, which uses a DataTable as its DataSource. the DataTable is populated by a method which calls a stored procedure...
6
by: Tejpal Garhwal | last post by:
I have datagrid filled with some data rows. At the run time i want know how many total rows are there in the data grid ? Any idea ? Any Suggestions ? Thanks in advance Tej
1
by: Fred Morrison | last post by:
Is it just me or is there something grossly wrong with the Windows Forms DataGrid control that won't tell me the row count inside it? I'm not talking about just visible rows (what the heck good is...
10
by: Zak McGregor | last post by:
Hi all is it possible to get a count(1) statemment, for example here: select count(1) from results where fixture=4916 and winner=away group by winner; to return a 0 value instead of...
2
by: kumar mcmillan | last post by:
hi. I am using a pseudo "pivot table" SQL query to generate a report but I am totally stumped on why the COUNT() function isn't getting me the expected results and was wondering if anyone has some...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.