private void btnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { nbcDSDocGia.OptionsNavPane.NavPaneState = DevExpress.XtraNavBar.NavPaneState.Expanded; if (them) { tbTenDG.Clear(); tbDiaChi.Clear(); tbSDT.Clear(); tbDonVi.Clear(); string maDG = nextMa(DocGia_BUS.LastMaDG()); // them = false; DGbindingSource.AddNew(); //mã sinh viên tự tăng gvDocGia.SetFocusedRowCellValue(colMaDG, maDG); tbMaDG.Text = maDG.ToString(); //trỏ tới dòng cuối cùng trong gridview gvDocGia.FocusedRowHandle = gvDocGia.RowCount - 1; tbTenDG.Focus(); } else { gvDocGia.FocusedRowHandle = gvDocGia.RowCount - 1; tbTenDG.Focus(); } // frm.Show(); }