Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   rowcount (http://www.velocityreviews.com/forums/t762316-rowcount.html)

et 09-22-2005 01:01 AM

rowcount
 
How can I get a count of rows in a datagrid?



Jack Li 09-22-2005 03:47 AM

Re: rowcount
 
You may want to use:
DataTable.Rows.Count

Regards,
Jack Li
MVP (ASP.NET)

"et" <eagletender2001@yahoo.com> wrote in message
news:u12J3ExvFHA.596@TK2MSFTNGP12.phx.gbl...
> How can I get a count of rows in a datagrid?
>




Elton Wang 09-22-2005 03:11 PM

Re: rowcount
 
datagrid.Items.Count


HTH


"et" <eagletender2001@yahoo.com> wrote in message
news:u12J3ExvFHA.596@TK2MSFTNGP12.phx.gbl...
> How can I get a count of rows in a datagrid?
>
>




Scott Mitchell [MVP] 09-23-2005 03:59 AM

Re: rowcount
 
Jack Li wrote:
> You may want to use:
> DataTable.Rows.Count


This assumes that you are binding a DataTable to a DataGrid. But if
you're binding a DataReader this approach won't work. (If you're
binding an Array or other collection, you can use similar code - just
utilize the Count property.)

A more flexible approach is, *after* you bind the data to the DataGrid,
check out the DataGridID.Items.Count property.

hth


> Regards,
> Jack Li
> MVP (ASP.NET)
>
> "et" <eagletender2001@yahoo.com> wrote in message
> news:u12J3ExvFHA.596@TK2MSFTNGP12.phx.gbl...
>
>>How can I get a count of rows in a datagrid?
>>

>
>
>



--

Scott Mitchell [ASP.NET MVP]
mitchell@4GuysFromRolla.com
http://www.4GuysFromRolla.com/ScottMitchell


All times are GMT. The time now is 02:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.