Ejemplo n.º 1
0
        public void HienThiVaoDGV(DataGridView dGV,
                                  BindingNavigator bN,
                                  TextBox txtTenDangNhap,
                                  TextBox txtTenNV,
                                  ComboBox cboQuyen,
                                  TextBox txtMatKhau)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = data.DanhSach();

            txtMatKhau.DataBindings.Clear();
            txtMatKhau.DataBindings.Add("Text", bS, "MATKHAU", false, DataSourceUpdateMode.Never);

            txtTenDangNhap.DataBindings.Clear();
            txtTenDangNhap.DataBindings.Add("Text", bS, "TENDANGNHAP", false, DataSourceUpdateMode.Never);

            txtTenNV.DataBindings.Clear();
            txtTenNV.DataBindings.Add("Text", bS, "TENNV", false, DataSourceUpdateMode.Never);

            cboQuyen.DataBindings.Clear();
            cboQuyen.DataBindings.Add("SelectedIndex", bS, "QUYEN", false, DataSourceUpdateMode.Never);

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }