private void drgHocSinh_CellClick(object sender, DataGridViewCellEventArgs e) { try { int numrow; numrow = e.RowIndex; txtID.Text = drgHocSinh.Rows[numrow].Cells[0].Value.ToString(); txtHoTen.Text = drgHocSinh.Rows[numrow].Cells[1].Value.ToString(); cbGT.Text = drgHocSinh.Rows[numrow].Cells[2].Value.ToString(); txtNS.Text = drgHocSinh.Rows[numrow].Cells[3].Value.ToString(); txtDiaChi.Text = drgHocSinh.Rows[numrow].Cells[4].Value.ToString(); txtSDT.Text = drgHocSinh.Rows[numrow].Cells[5].Value.ToString(); txtEmail.Text = drgHocSinh.Rows[numrow].Cells[6].Value.ToString(); cbTinhTrang.Text = drgHocSinh.Rows[numrow].Cells[8].Value.ToString(); var lophientai = init.lop.First(x => x.TenLop.Contains(drgHocSinh.Rows[numrow].Cells[10].Value.ToString())); init.getcbKhoaHoc(lophientai.TenKhoi, init.khoaHoc.First(x => x.NamHoc == lophientai.IdKhoaHoc).NamHoc.ToString(), lophientai.TenLop); } catch (Exception) { return; } }
private void cbKhoaHoc_SelectedIndexChanged(object sender, EventArgs e) { init.getcbKhoaHoc("", init.khoaHoc[cbKhoaHoc.SelectedIndex].NamHoc.ToString(), ""); }