I have a form1 and form2 ..
form1: I have a datagridview with a button column. When I click on the button cell for any row the corresponding row values will be transferred to form2. That was working fine.
Form 2: by using setters and getters I have got the values from form1 and I represent the values in textboxes in form 2, and that was fine.
I have a checkbox in form 2. When I click on the check box, I need to remove the row in datagrid view in form 1 (whose row values are transferred to form 2 when I click on the button cell. That row will be deleted from the datagrid view in form1).
How do I fix this?
When you pass data from
Form1toForm2, also pass the row index. It will help you delete the row easily.Either mark the
DataGridViewof Form1publicor pass it as a constructor parameter toForm2and then callDataGridView1.Rows.RemoveAt(rowIndex);to delete row at the index specified byrowIndex.