private void DeleteBarItem_ItemClick(object sender, ItemClickEventArgs e) { if (working_time != null) { DialogResult dialogResult = XtraMessageBox.Show("You really want to delete the selected element?", "Sure", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { if (!_DB.DeleteWorkingDay(working_time)) { XtraMessageBox.Show("Element is not deleted!"); } _working_time = _DB.GetWorkingTime(); WorkingTimeGridControl.DataSource = _working_time; Odd_EvenCB.SelectedIndex = 0; Morning_AfternoonCB.SelectedIndex = 0; } } else { XtraMessageBox.Show("Element is not selected!"); } }