Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / September 2005

Tip: Looking for answers? Try searching our database.

rowcount

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
et - 22 Sep 2005 02:01 GMT
How can I get a count of rows in a datagrid?
Jack Li - 22 Sep 2005 04:47 GMT
You may want to use:
DataTable.Rows.Count

Regards,
Jack Li
MVP (ASP.NET)

> How can I get a count of rows in a datagrid?
Scott Mitchell [MVP] - 23 Sep 2005 04:59 GMT
> 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)
>
>>How can I get a count of rows in a datagrid?

Signature

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

Elton Wang - 22 Sep 2005 16:11 GMT
datagrid.Items.Count

HTH

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.