protected void btnDeleteSelected_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
if (((CheckBox)row.FindControl("checkBox1")).Checked == true)
{
/* Get Table Id From Row */
string id = GridView1.Rows[row.RowIndex].Cells[0].Text;
/* delete from database */
SqlConnection con = new SqlConnection("Connection String");
con.Open();
SqlCommand comm = new SqlCommand("delete from TableName where id='" + id + "'", con);
comm.ExecuteNonQuery();
}
}
/* Refresh the Grid*/
}