C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Check all check boxes when you click on Select All button


Posted Date: 22 May 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: Siva PrasadMember Level: Gold    
Rating: Points: 10



Here is the code sample how to check all the check boxes inside gridview if you click on Select ALll button

Steps:
1) Bind Data to GridView

2) Convert check box column to Template column.

3) Add a button called all "Select All".

4) Write the below code in Select All click event..


int iteration = 0;
for ( iteration = 0 ; iteration < GridView1.Rows.Count ; iteration++ )
{
CheckBox checkBox = ( CheckBox ) GridView1.Rows [ iteration ].Cells [ 0 ].FindControl ( "cbCheckBox" );
checkBox.Checked = true;
}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Check boxes  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to know whick Check box was checked in GridView
Previous Resource: Disabled CheckBox using javascript
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use