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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top