private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // Check if row is not column header if(e.RowIndex > -1) { // Show appointment details form using(var appForm = new FormAppointmentDetails(_foundStaff.Appointments[e.RowIndex])) { appForm.ShowDialog(); } } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { // Make sure it's not a column header if (e.RowIndex > -1) { DialogResult result; // Open the appointment details form using (var appForm = new FormAppointmentDetails(_foundPatient.Appointments[e.RowIndex])) { result = appForm.ShowDialog(); } if (result == DialogResult.OK) { RefreshForm(); } } }