Exemplo n.º 1
0
        private void btnLoadFile_Click(object sender, EventArgs e)
        {
            DialogResult rs = openFileDialog.ShowDialog();

            try
            {
                if (rs == DialogResult.OK)
                {
                    grwDanhSach.Columns.Clear();
                    DataTable dt = Excel.Import(openFileDialog.FileName);
                    grwDanhSach.DataSource = dt;
                    grwDanhSach.Visible    = true;
                    DataGridViewComboBoxColumn objCol = XuLyDataGridView.CreateComboboxColumn("BẬC HỌC", XuLyXml.DocDsBacHoc());
                    grwDanhSach.Columns.Insert(3, objCol);
                    DataGridViewCheckBoxColumn objChe = XuLyDataGridView.CreateCheckBoxColumn("THI PHÒNG MÁY");
                    grwDanhSach.Columns.Insert(4, objChe);
                    grwDanhSach.Columns.RemoveAt(11);
                    DataGridViewTextBoxColumn objtex = XuLyDataGridView.CreateTextboxColumn("PHÒNG THI");
                    grwDanhSach.Columns.Insert(11, objtex);
                    DataGridViewButtonColumn objbot = XuLyDataGridView.CreateButtonColumn("THÊM");
                    grwDanhSach.Columns.Insert(12, objbot);
                    FormatColumn();
                    btnXepLichThi.Enabled = btnXuatExcel.Enabled = btnInKetQua.Enabled = true;
                }
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 2
0
        public frmChonNhom(DataGridView sou)
        {
            InitializeComponent();
            dgrDanhSach.DataSource = source = sou;
            DataGridViewButtonColumn objbot = XuLyDataGridView.CreateButtonColumn("CHỌN");

            dgrDanhSach.Columns.Insert(5, objbot);
            dgrDanhSach.Columns[0].Width        = 40;
            dgrDanhSach.Columns[6].Width        = 50;
            dgrDanhSach.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
Exemplo n.º 3
0
        public frmChonPhong(DataTable source)
        {
            InitializeComponent();
            dgrDanhSach.DataSource = source;
            XuLyDataGridView.ReadOnly(dgrDanhSach);
            DataGridViewButtonColumn objbot = XuLyDataGridView.CreateButtonColumn("CHỌN");

            dgrDanhSach.Columns.Insert(6, objbot);
            dgrDanhSach.Columns[0].Width        = 40;
            dgrDanhSach.Columns[6].Width        = 50;
            dgrDanhSach.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }