Wednesday, September 26, 2018

Gridview Checkbox

 protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow grow in GridView1.Rows)
        {
            //Searching CheckBox("chkDel") in an individual row of Grid  
            CheckBox chkdel = (CheckBox)grow.FindControl("ch");
            //If CheckBox is checked than delete the record with particular empid  
            if (chkdel.Checked)
            {
                int id = Convert.ToInt32(grow.Cells[0].Text);
                DeleteRecord(id);
            }
        }

No comments:

Post a Comment

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...