Пример #1
0
        private void LoadGridView()
        {
            //先将控件记录集清空
            moduleList_dgv.Columns.Clear();
            DataTable dt = new DataTable();

            dt = ComMethod.ConverToDataTable <ModuleInfo>(rInfo.Serials);
            moduleList_dgv.DataSource = dt;
            moduleList_dgv.Columns[0].DataPropertyName = "serial_cd";
            moduleList_dgv.Columns[1].DataPropertyName = "model";
            moduleList_dgv.AutoSizeColumnsMode         = DataGridViewAutoSizeColumnsMode.AllCells;
        }
        /// <summary>
        /// 加载dataGridView控件
        /// </summary>
        private void LoadGridView()
        {
            dataGridView1.Columns.Clear();

            if (cInfo.Records.Count < 1)
            {
                return;
            }
            dataGridView1.DataSource = ComMethod.ConverToDataTable <RecordInfo>(cInfo.Records);
            dataGridView1.Columns[0].DataPropertyName = "record_id";
            dataGridView1.Columns[1].DataPropertyName = "qty";
            dataGridView1.AutoSize            = true;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
        }
Пример #3
0
        private void LoadGridView()
        {
            moduleList_dgv.Columns.Clear();

            if (rInfo.Serials.Count < 1)
            {
                return;
            }
            moduleList_dgv.DataSource = ComMethod.ConverToDataTable <ModuleInfo>(rInfo.Serials);
            moduleList_dgv.Columns[0].DataPropertyName = "serial_cd";
            moduleList_dgv.Columns[1].DataPropertyName = "model";
            moduleList_dgv.AutoSize            = true;
            moduleList_dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
        }