private void btn_Add_Punch_Click(object sender, EventArgs e) { DataGridViewRow selectedRow = null; editPunchForm = new EditPunchForm(selectedRow); editPunchForm.FormClosed += editPunchForm_FormClosed; editPunchForm.Show(); }
private void dgv_Punches_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dgv_Punches.SelectedCells.Count > 0) { int selectedrowindex = dgv_Punches.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dgv_Punches.Rows[selectedrowindex]; editPunchForm = new EditPunchForm(selectedRow); editPunchForm.FormClosed += editPunchForm_FormClosed; editPunchForm.Show(); } }