/// <summary>
        /// 设置表头,注意表列的操作用列代码(Tag中),不要用HeaderText
        /// </summary>
        private void _setColHeader()
        {
            this.Columns.Clear();
            if (_cols == null || this._tableType == null)
            {
                return;
            }

            #region 固定的列
            this.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText   = "项目",
                ReadOnly     = true,
                Name         = "itemName",
                Tag          = "",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells,
                SortMode     = DataGridViewColumnSortMode.NotSortable,
                Visible      = this._tableType.itemNameShow,
                Frozen       = true
            });
            this.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText   = "项目英文",
                ReadOnly     = true,
                Name         = "itemEnName",
                Tag          = "",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells,
                SortMode     = DataGridViewColumnSortMode.NotSortable,
                Visible      = this._tableType.itemEnShow,
                Frozen       = true
            });
            this.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText   = "单位",
                ReadOnly     = true,
                Name         = "itemUnit",
                Tag          = "",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells,
                SortMode     = DataGridViewColumnSortMode.NotSortable,
                Visible      = this._tableType.itemUnitShow,
                Frozen       = true
            });
            this.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText   = "代码",
                ReadOnly     = true,
                Name         = "itemCode",
                Tag          = "",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells,
                SortMode     = DataGridViewColumnSortMode.NotSortable,
                Visible      = this._tableType.itemCodeShow,
                Frozen       = true
            });
            #endregion

            this.columnList = new GridOilColumnList(this, _cols);
        }
Beispiel #2
0
 internal GridOilColumnGroup(GridOilColumnList list)
 {
     List       = list;
     LabColumn  = new GridOilColumnItem(this, GridOilColumnType.Lab);
     CalcColumn = new GridOilColumnItem(this, GridOilColumnType.Calc);
 }