Created
June 6, 2011 14:02
-
-
Save phpleo/1010313 to your computer and use it in GitHub Desktop.
Recorer checkbox en gridview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://www.codeproject.com/KB/webforms/SelChkboxesDataGridView.aspx | |
| 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); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment