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