Multiple row deletion in GridView in Asp.net

Multiple row deletion in GridView in Asp.net

Multiple row deletion in GridView in Asp.net on Button Click

CheckBox chk = new CheckBox();
foreach (GridViewRow dg1 in GridView1.Rows)
{
chk = (CheckBox)dg1.FindControl(“CheckBox1”);
Label lbldel = (Label)dg1.FindControl(“Label2”);

if (chk.Checked == true)
{
int ID = Convert.ToInt32(lbldel.Text);

// Pass this ID to Delete Command

Label1.Text = “data deleted”;

}
}

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply