Sep 03, 2010 10:25 AM|AngelicOne|LINK
this is a duplicate of my other post. The reason for this is I can't view my first topic about this. I tried in my laptop, pc, and also my friend's pc but I can't view the topic. It slows down the browser and will hang.
So here it is.
My gridview is being generated at runtime by a dataset. My first column is a template field with checkbox, how to delete a selected row? C# please.
This is my code but it doesn't work.
protected void DeleteSelected_Click(object sender, EventArgs e)
foreach (GridViewRow row in GridView1.Rows)
CheckBox cb = (CheckBox)row.FindControl("RegistrySelector");
string id = GridView1.DataKeys[row.RowIndex].Value.ToString();
string del = "delete from EnrollTbl where Register_ID="+id;
da = new SqlDataAdapter(del,con);
ds = new DataSet();
GridView1.DataSource = ds;