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

How to determine the number of rows or columns within a DataGrid

Can someone tell me how you determine the number of rows (or columns) are in
a datagrid? Under the debugger I say the property DataGridRows (which is
what I want) but it doesn't appear to be usable within code. Its protection
level makes it inacccessible.
--
Steve
Dec 20 '05 #1
1 1070
Steve,

Generally speaking, you know that the datagrid is bound to an IList
implementation. You can cast the DataSource object to IList (or IListSource
perhaps) and then get the number of items from there.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steve Teeples" <St**********@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
Can someone tell me how you determine the number of rows (or columns) are
in
a datagrid? Under the debugger I say the property DataGridRows (which is
what I want) but it doesn't appear to be usable within code. Its
protection
level makes it inacccessible.
--
Steve

Dec 21 '05 #2

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

Similar topics

3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
3
by: BBFrost | last post by:
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows within a datagrid have been changed. The...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
7
by: Brian Henry | last post by:
Hi, I have a data grid that has the following properties EnableViewState = false AllowPaging = true AllowSorting = true AllowCustomPaging = false now, when the page switches I want to get...
2
by: David | last post by:
Hi, How can I edit all rows of a datagrid at the same time? I have a datagrid that has some bound columns and some template columns with a asp:textbox inside. (Textbox for values that can...
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...
0
by: Nick | last post by:
Hi, This is a very common issue. I have a read only Windows Application datagrid, on which i want to prevent the tabbing between the columns and rows. What needs to happen is this: When i...
2
by: Flack | last post by:
Hey guys, I have a DataGrid and DataTable field in my class : private ImageDataGrid dataGrid1; //ImageDataGrid extends dataGrid and just overides OnMouseDown private DataTable dt = new...
0
by: Flack | last post by:
I have pasted at the end of this message a small sample program I whipped up to do some testing. It's a form with a datagrid and two buttons. Each button clears the dataTable that is the source...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...

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.