private void grvLoaiPhuCap_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (grvLoaiPhuCap.FocusedRowHandle >= 0) { drLoaiPhuCap = grvLoaiPhuCap.GetDataRow(grvLoaiPhuCap.FocusedRowHandle); cBNS_LoaiPhuCap.ToInfo(ref pNS_LoaiPhuCapInfo, drLoaiPhuCap); if (ofrmPhuCap != null) { ofrmPhuCap.IDNS_LoaiPhuCap = int.Parse(drLoaiPhuCap[pNS_LoaiPhuCapInfo.strNS_LoaiPhuCapID].ToString()); } } if (grvLoaiPhuCap != null) { if (grvLoaiPhuCap.DataRowCount > 0 && grvLoaiPhuCap.FocusedRowHandle >= 0) { SetControl(true); drLoaiPhuCap = grvLoaiPhuCap.GetDataRow(grvLoaiPhuCap.FocusedRowHandle); return; } } SetControl(false); drLoaiPhuCap = null; }