Skip to content

Instantly share code, notes, and snippets.

@phpleo
Created June 6, 2011 14:02
Show Gist options
  • Select an option

  • Save phpleo/1010313 to your computer and use it in GitHub Desktop.

Select an option

Save phpleo/1010313 to your computer and use it in GitHub Desktop.
Recorer checkbox en gridview
// 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