Geeks With Blogs

AzamSharp Some day I will know everything. I hope that day never comes.
Selecting values from the checkboxes inside the GridView control is pretty simple. Check out the code below.
// StringBuilder object 
        StringBuilder str = new StringBuilder(); 

        // Select the checkboxes from the GridView control 
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            GridViewRow row = GridView1.Rows[i];
            bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked;
            if (isChecked)
            {
                // Column 2 is the name column 
                str.Append(GridView1.Rows[i].Cells[2].Text); 
            }                
       }
Checkout the complete article: Selecting Checkboxes inside the GridView Control Posted on Saturday, July 23, 2005 4:42 PM | Back to top


Comments on this post: Selecting Multiple Checkboxes inside the GridView Control

# Selecting Multiple Checkboxes inside the GridView Control in VB.net
Requesting Gravatar...
Selecting Multiple Checkboxes inside the GridView Control in VB.net
Left by farooq ahmed on Sep 28, 2006 6:41 PM

# re: Selecting Multiple Checkboxes inside the GridView Control
Requesting Gravatar...
There are many online language convertors available for free. Please do a search on google. One good converter is from Kamal Patel.
Left by AzamSharp on Sep 29, 2006 6:33 AM

Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net