private void bDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (XtraMessageBox.Show("Are you sure you want to delete this patient record?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { string pid = grv.GetFocusedRowCellValue(colPID).ToString(); ServerToClient sc = new ServerToClient(); PatientContext px = new PatientContext(); sc = px.DeletePatient(pid); if (sc.Message == null) { XtraMessageBox.Show("Patient ID " + pid + " deleted successfully!"); LoadPatients(); } else { XtraMessageBox.Show(sc.Message); } } }