private void gridControl_DanhGiaChatLuongMau_ProcessGridKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && gridView_DanhGiaChatLuongMau.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing) { if (XtraMessageBox.Show("Bạn có muốn xóa danh mục này hay không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { try { if (BioBLL.DelDanhGia(Convert.ToInt32(gridView_DanhGiaChatLuongMau.GetRowCellValue(gridView_DanhGiaChatLuongMau.FocusedRowHandle, "RowIDChatLuongMau").ToString()))) { this.gridControl_DanhGiaChatLuongMau.DataSource = BioBLL.GetListDanhGia(); } else { XtraMessageBox.Show("Xóa danh mục thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { XtraMessageBox.Show("Xóa danh mục thất bại!", "Bệnh viện điện tử .NET", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } }