Hi

can anyone tell me what the best way to find out how many rows are in
a datagrid? I used to use datagrid.rows but that doesnt look avaliable
in .NET

Thanks Neil

Re: Rows In Datagrids by Peter

Peter
Mon Feb 19 05:43:20 CST 2007

You can get the count from whatever you have set as the datasource for the
grid, whether that be some collection class or a datatable. You will
probably already have a reference to the object so that you can work with it
directly, alternatively you must get the DataSource object from the DataGrid
and it will either implement IList, or IListSource. If the latter you can
call GetList to get the IList implementing object and then retrieve the
count (IList inherits ICollection).

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

"shawrie" <neil.shaw@sanderson.com> wrote in message
news:1171883876.595551.38790@v45g2000cwv.googlegroups.com...
> Hi
>
> can anyone tell me what the best way to find out how many rows are in
> a datagrid? I used to use datagrid.rows but that doesnt look avaliable
> in .NET
>
> Thanks Neil
>