예제 #1
0
        private void cboNXB_LoadDataBase()
        {
            DataTable dt = BUS_OBJ.loadDSNXB();

            cboNXB.DataSource    = dt;
            cboNXB.DisplayMember = "TenNXB";
            cboNXB.ValueMember   = "MaNXB";
        }
예제 #2
0
        private void HienThiDuLieu()
        {
            this.dgvNXB.DataSource = null;
            this.dgvNXB.DataSource = BUS_OBJ.loadDSNXB();

            dgvNXB.DefaultCellStyle.Alignment            = DataGridViewContentAlignment.MiddleLeft;
            dgvNXB.Columns[0].HeaderText                 = "Mã NXB";
            dgvNXB.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            dgvNXB.Columns[1].HeaderText = "Tên NXB";
            dgvNXB.Columns[1].Width      = 200;
            dgvNXB.Columns[2].HeaderText = "Ghi chú";
            foreach (DataGridViewColumn col in dgvNXB.Columns)
            {
                col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                col.HeaderCell.Style.Font      = new Font("Segoe UI", 12F, FontStyle.Bold, GraphicsUnit.Pixel);
            }
        }