2
Answers

check checkbox in datagridview is checked or not

Shivaraj Poojary

Shivaraj Poojary

12y
5.2k
1
Hi Experts,

In my project i have datagridview with checkbox in the first column....I would like to know how to check if the checkbox is checked or not..
Please help me

Thanks in Advance
Answers (2)
0
Shivaraj Poojary

Shivaraj Poojary

NA 92 316.6k 12y
Hi Gohil, Thanks for the reply..I am developing a windows application.
0
Gohil Jayendrasinh

Gohil Jayendrasinh

NA 5.1k 3.7m 12y
Hi,

  if you use TemplateField ASP checkbox then

OnCheckedChanged="chkStatus_OnCheckedChanged"

public void chkStatus_OnCheckedChanged(object sender, EventArgs e)
{
    CheckBox chkStatus = (CheckBox)sender;
    GridViewRow row = (GridViewRow)chkStatus.NamingContainer;

   
    string cid = row.Cells[1].Text;
    bool status = chkStatus.Checked;

}


For more information inline-editing-and-updating in gridview with check-box

http://www.c-sharpcorner.com/uploadfile/jayendra/inline-editing-and-updating-in-gridview-with-check-box/