private void tbtnEdit_Click(object sender, EventArgs e) { if (dgLeaveList.SelectedRows.Count > 0) { frmLeaveEdit pForm = new frmLeaveEdit(); pForm.LeaveCode = dgLeaveList.SelectedRows[0].Cells[0].Value.ToString(); pForm.FormLeaveList = this; pForm.ShowDialog(); } }
private void dgLeaveList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (dgLeaveList.SelectedRows.Count > 0) { frmLeaveEdit pForm = new frmLeaveEdit(); pForm.LeaveCode = dgLeaveList.Rows[e.RowIndex].Cells[0].Value.ToString(); pForm.FormLeaveList = this; pForm.ShowDialog(); } } catch { } }