private void LoadLop() { string maCN = ""; if (cbbChuyenNganh.Items.Count > 0) { maCN = cbbChuyenNganh.SelectedValue.ToString().Trim(); } LopDAO dao = new LopDAO(); var list = dao.GetByMaChuyenNganh(maCN).Select(t => new { MaLop = t.MaLop, TenLop = t.TenLop }).ToList(); dgvLop.DataSource = list; if (list.Count > 0) { btnSelectLop.Enabled = true; } else { btnSelectLop.Enabled = false; } }