473,887 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.visibl erowcount

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

Thanks in advance.
Nov 21 '05 #1
2 11134
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.visibl erowcount

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.DataS ource = ds.Tables("Empl oyee")

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.visibl erowcount

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
44141
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 scott/tiger@common control=/full_path/test.ctl log=/full_path/adhoc/test.log SQL*Loader: Release 9.2.0.1.0 - Production on Tue Sep 2 10:49:27 2003 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
2
3318
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 the selected lie item at which case I would pop up a separate dialog box to do so, in the debugging code, the dataview.count would return 0. I get a error message because I tried to get values out of a dataview that holds 0 items. Does anyone...
2
6969
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: <asp:DataGrid AllowCustomPaging="false" AllowPaging="true" AllowSorting="true"
2
1384
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 : "select count(*) from ...)" Thanks by advance arno
6
4608
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 through an SqlCommand object, which accepts two input parameters which affect the query range. the problem she's experiencing is that with all input parameter values,
6
6711
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
6585
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 that, pray tell?). I want the TOTAL rows count in the DataGrid control. Oh sure, there could be a bound DataTable, DataView, or whatever that can be rextracted; but, that means my User Interface has to know something about how the data was...
10
3756
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 absolutely nothing if no rows match fixture=4916 and winner=away? I get absolutely no results at all.
2
7003
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 ideas... it is for a statistical report showing which lead source a member followed when creating a profile (i.e. CNN ad, Chicago Tribune ad, etc), grouped by age range. here is the SQL that should total up rows based each specific
0
9957
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10771
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10877
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9593
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4633
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4239
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.