471,315 Members | 1,467 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,315 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 1029
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Daniel Walzenbach | last post: by
7 posts views Thread by Brian Henry | last post: by
2 posts views Thread by David | last post: by
10 posts views Thread by Aaron Smith | last post: by
2 posts views Thread by Flack | last post: by
reply views Thread by Flack | last post: by

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.