private void radGridView3_CellDoubleClick(object sender, GridViewCellEventArgs e) { if (e.RowIndex != -1) { int appointmentId = Convert.ToInt32(radGridView3.Rows[e.RowIndex].Cells[0].Value.ToString()); EditAppointmentForm edaForm = new EditAppointmentForm(appointmentId); var result = edaForm.ShowDialog(); if (result == DialogResult.OK) { AppointmentRepository repo = new AppointmentRepository(); radGridView3.DataSource = repo.getAppointmentByContractId(selectedContractId).ToList(); ContractRepository repository = new ContractRepository(); radGridView1.DataSource = repository.getContractsByCustomerId(customerId).ToList(); } } }