Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to delete specific gridview record on check box selection in win form application please guide me
i am doing this in asp what for winForm
C#
protected void btnDelete_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            if (row.RowType == DataControlRowType.DataRow)
            {
                CheckBox check1 = (CheckBox)row.FindControl("chkSelect");

                if (check1.Checked == true)
                {

                    var id = row.FindControl("LinkButton1") as LinkButton;
                   objClass.ClassID = Convert.ToInt32(id.Text);
                   objClass.UserID = 1;
                   objClass.Delete();

                   GridviewDatabind();

                }

            }
        }
    }
Posted
Updated 29-Mar-14 0:52am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900