private void DeleteBarItem_ItemClick(object sender, ItemClickEventArgs e) { if (prescription != null) { DialogResult dialogResult = XtraMessageBox.Show("You really want to delete the selected element?", "Sure", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { if (!_DB.DeletePrescription(prescription)) { XtraMessageBox.Show("Element is not deleted!"); } _prescription = _DB.GetPrescriptionForPatient(patient); PresciptionGridControl.DataSource = _prescription; ClearData(); } } else { XtraMessageBox.Show("Element is not selected!"); } }