private void txtTimKiem_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { string tennhom = txtTimKiem.Text; quanlynhom2 = QuanLyNhom.GetFromFile(pathDataFile, tennhom); quanlynhom2.ListTenLienLac = QuanlyTenLienLac.GetNhom(pathDataFile2, quanlynhom2.TenNhom); bdstenlienlac.DataSource = quanlynhom2.ListTenLienLac; dgvtenlienlac.DataSource = bdstenlienlac; } }
private void dgvnhom_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { //Lưu lại dòng dữ liệu vừa kích chọn DataGridViewRow row = this.dgvnhom.Rows[e.RowIndex]; //Đưa dữ liệu vào textbox string tennhom = row.Cells[0].Value.ToString(); quanlynhom2 = QuanLyNhom.GetFromFile(pathDataFile, tennhom); quanlynhom2.ListTenLienLac = QuanlyTenLienLac.GetNhom(pathDataFile2, quanlynhom2.TenNhom); bdstenlienlac.DataSource = quanlynhom2.ListTenLienLac; dgvtenlienlac.DataSource = bdstenlienlac; } }