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

Data Transfer Java Script using Local Storage

  Page 1: index.html <!DOCTYPE html> <html> <head> <title> Page 1 </title> </head> <body> ...