473,508 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where is DataGrid.Rows.Count ?

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 bound.
Hey Microsoft. How about a DataGrid.Rows.Count method in the next version?
Nov 20 '05 #1
1 6547

There is no row count on the grid. The new architecture in .NE
attempts to separate the presentation from the data. So thei
philosophy is that the grid doesn't care about the data, onl
displaying it. With that being said, to get a count in your display
you need to contact the BindingManagerBase

BindingManagerBase bm = DataGrid.BindingContext[DataGrid.DataSource];

Then bm.Count will contain the rows.

It's frustrating at first, but most people agree that once you lear
the architecture in .NET it makes a lot more sense and really help
create much more robust apps.

Fred Morrison wrote:
*Is it just me or is there something grossly wrong with the Window
Forms
DataGrid control that won't tell me the row count inside it? I'
not
talking about just visible rows (what the heck good is that, pra
tell?). I
want the TOTAL rows count in the DataGrid control. Oh sure, ther
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 wa
bound.
Hey Microsoft. How about a DataGrid.Rows.Count method in the nex
version?


pw197
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message247812.htm

Nov 20 '05 #2

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

Similar topics

3
539
by: sam | last post by:
Hello Group, Havent had luck posting it to microsoft.public.dotnet.framework.aspnet.datagridcontrol group. Excuse me for the cross posting. I have a datagrid which needs to be split into multiple...
1
2581
by: Soul | last post by:
*** I am not sure this question belong to *.languages.csharp or *.framework.windowsdorms.databinding, so I post to both *** Hi, Currently I have a DataGrid which bind to a DataSet. One of...
5
9165
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
2
3275
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...
4
5335
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
1
1402
by: sam | last post by:
Hello Group, I am working on inserting Rows in the datagrid as follows: Private Function addHeaderLines(ByVal ds As DataSet) As DataSet Dim dr, drBlank As DataRow Dim count, repeatCount,...
4
2707
by: skOOb33 | last post by:
I successfully autosized the columns and rows on my Datagrid, and am now facing another issue. Having the sorting ability by clicking the column headers is key, but when I do that, it resizes all...
1
2576
by: sp | last post by:
Hello I have a problem with the refresh performance in datagrid – when datagrid is being shown it is so slow that I can see one by one cells is drawn -datagrid contains about 35x40 of...
0
2502
by: moondog | last post by:
Just in case anyone else out there is having the same problem of the page numbers appearing in one column instead of across the row, here's how to fix the problem courtesy of swn...@gmail.com from...
0
7133
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
7336
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
7405
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
7504
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
5643
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,...
1
5059
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...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1568
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 ...
0
435
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...

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.