In Form1(Parent) i add DataGridView and it contents 10 rows. and column[5] is CheckBox, and this CheckBox is ReadOnly.
when double click on Row1 the Form2(Child) open and Checkbox checked, and when close Form2 the Checkbox unchecked, ect.
How Checkbox unchecked when Form2 is Closing? plz help!
What I have tried:
private void datagridview1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
Form2 form = new Form2();
datagridview1.CurrentRow.Cells[5].Value = true;
form.MdiParent = this.MdiParent;
form.Show();
form.FormClosing += Frm_FormClosing
}
private void Frm_FormClosing(object sender, FormClosingEventArgs e)
{
foreach (Form frm in Application.OpenForms)
{
foreach (DataGridViewRow row in datagridview1.Rows)
{
if (frm.Text == row.Cells[1].Value.ToString())
{
row.Cells[5].Value = null;
}
}
}
}