Beispiel #1
0
        /// <summary>
        /// 加载列名选择Grid
        /// </summary>
        /// <param name="fName"></param>
        public void Load_Choose(string fName)
        {
            ImportExcel import = new ImportExcel();
            DataTable   dt     = import.LoadDGV_Choose(fName);

            DGV_Choose.DataSource = dt;
            //创建下拉对象
            DataGridViewComboBoxColumn dataGridViewComboBox = new DataGridViewComboBoxColumn();

            dataGridViewComboBox.DataSource    = import.GetTableColunm(menuAttributecs.DataTable);
            dataGridViewComboBox.ValueMember   = "name";
            dataGridViewComboBox.DisplayMember = "name";
            dataGridViewComboBox.HeaderText    = "数据库列名";
            dataGridViewComboBox.DisplayStyle  = DataGridViewComboBoxDisplayStyle.DropDownButton;
            DGV_Choose.Columns.Add(dataGridViewComboBox);
        }