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

number of rows in a datagrid

Is there a way to find out the number of rows in a datagrid without
accessing the original datatable or dataset on which the recordsource is
based?

x = datagrid1.rows.count would be cool, but it's not there.
Nov 20 '05 #1
3 1578
Is there a way to find out the number of rows in a datagrid without
accessing the original datatable or dataset on which the recordsource is
based?


You can find it from the count of the data in the grid which is the
datasource, why should there be another methode?

Cor
Nov 20 '05 #2
That's fine. My confusion was that the datasource was no longer declared by
the time I wanted to know how many rows. It hadn't initially occurred to me
to dim a new dataset and make it equal to the datasource of the datagrid in
order to get the count property.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Is there a way to find out the number of rows in a datagrid without
accessing the original datatable or dataset on which the recordsource is
based?


You can find it from the count of the data in the grid which is the
datasource, why should there be another methode?

Cor

Nov 20 '05 #3
Hi Curtis

You dont have to redeclare another dataset if all you want is a row count.

Me.BindingContext(Me.dgMyDataGrid.Datasource).Coun t

should do the trick.

hth
Richard
Nov 20 '05 #4

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

Similar topics

0
by: Alpha | last post by:
I'm working on a Window based application. I have 2 textboxes and a datagrid on a form. The textboxes are databind to the same datasource as datagrid. I want to use the following to update the...
4
by: Tim T | last post by:
Hi, I have a stored procedure executing a search and an asp.net page displaying the results in a datagrid. The datagrid has paging on it, I am using Visual Studio.NET and can't see any option...
0
by: John Shum | last post by:
I prepare a UserControl that act as a lookup control, once the code is enter in the TextBox, the description will appear in another TextBox outside the UserControl of the same row in a DataGrid via...
10
by: Aaron Smith | last post by:
If I have a datagrid and the bound data file only have 4 rows in it, the grid will show the 4 rows. However, there is blank space below that until it reaches the bottom of the grid. Is there a way...
4
by: Melson | last post by:
Hi I've a problem. Can anyone help. I would like to use datagrid for data entry. How can I set the number of rows in the datagrid. And use the datagrid to update the ms sql table. regards...
2
by: patang | last post by:
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...
3
by: Gerhard | last post by:
I would like a DataGrid I am using to show a default number of rows (10) with the heading, even if the dataset it is bound to returns less than that number of rows (0-9). It is a databound grid...
1
by: Mike | last post by:
Hi, Which property or method returns the number of rows in a DataGrid? Thanks -- Regads, Rochdi
2
by: Lars Netzel | last post by:
Hi I need to have a limitation for the number of rows one can add in a datagrid (bound from a DataTable), in this case maximum should be 10 rows. My approach I guess is to catch the rownumber...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.