Exemplo n.º 1
0
 private void gridControl_Employee_ProcessGridKey(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete && gridView_Employee.State != DevExpress.XtraGrid.Views.Grid.GridState.Editing)
     {
         if (XtraMessageBox.Show("Bạn có muốn xóa nhân viên này hay không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No)
         {
             try
             {
                 if (BioBLL.DelEmployee(gridView_Employee.GetRowCellValue(gridView_Employee.FocusedRowHandle, "EmployeeCode").ToString()))
                 {
                     gridControl_Employee.DataSource = BioBLL.DTEmployee(string.Empty);
                 }
             }
             catch { return; }
         }
     }
 }