AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 How to Loop through GridView Rows? GridViewRow
Posted by Moderator1 on  6/17/2008 8:49:40 PM 44922 Views
Use GridViewRow class to loop through or navigate the GridView rows from outsite the GridView control's event.

For example, you need to navigate all the rows in a gridview control and find a child control placed inside it. The sample code below helps you to find a Checkbox placed inside a GridView control.

foreach (GridViewRow gvrow in GridView1.Rows)
{
CheckBox CheckBox1 = (CheckBox)gvrow.FindControl("CheckBox1");
if (CheckBox1.Checked)
{
//Do your operations here.
}
}

Post New Tips/Tricks View all Tips/Tricks

Featured Resources:
Easing the Migration to Microsoft SQL Server 2005
There are many business and technological reasons for making the move to SQL Server 2005 and SQL Server 2005 Enterprise Edition. In tandem with 64-bit computing platforms, SQL Server 2005 can boost performance by 30% in certain instances, deliver a better database management structure and bolster infrastructure security.
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - Free 207 Page Preview!
A compilation of the best solutions provided to common PHP questions.
100% Free Subscription until Stock lost.View complete list.
Sponsored by