Beispiel #1
0
        private void InitGrid()
        {
            #region 初始化列

            this.bandedGridView1.Columns.Clear();
            this.bandedGridView1.OptionsView.AllowCellMerge = true;

            //GridColumn col = GridViewHelper.AddColumn(this.bandedGridView1, "cInvAddCode", "老编码", 120);
            BandedGridColumn col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cInvAddCode", "老编码", 120);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            col.Summary.Add(DevExpress.Data.SummaryItemType.Count);
            col.Summary[0].DisplayFormat = "记录:{0}";
            col.Summary[0].FieldName     = "cInvAddCode";
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cInvDefine9", "客户名称", 150);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "InvCode", "存货编码", 130);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cInvName", "存货名称", 130);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cInvStd", "规格型号", 120);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "dubie", "镀别", 80);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "Free1", "头标", 80);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "dDate", "最近发货日期", 90);
            col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            // col.DisplayFormat.FormatString = "{yyyy-MM-dd}";
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cInvDefine13", "比重", 80);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
            this.bandedGridView1.Bands["chanpin"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "AvgQty", "月平均", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.False;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Red;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["others"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cInvDefine12", "预测天数", 80);
            col.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
            //col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            //col.AppearanceCell.ForeColor = Color.Red;
            //col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["others"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "PreQty", "预测数量", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.False;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Red;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["others"].Columns.Add(col);


            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "ZZQuantity", "在制品", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.True;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Blue;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["stock"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "NStockQty", "完工未入库", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.True;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Blue;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["stock"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "KCQuantity", "库存仓库", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.True;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Blue;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["stock"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "cusQuantity", "客户仓库", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.False;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Blue;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["stock"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "SumQuantity", "合计", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.False;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Blue;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["stock"].Columns.Add(col);

            col = GridViewHelper.AddBandColumn(this.bandedGridView1, "PlanQty", "数量", 80);
            col.OptionsColumn.AllowMerge   = DevExpress.Utils.DefaultBoolean.False;
            col.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            col.AppearanceCell.ForeColor   = Color.Blue;
            col.DisplayFormat.FormatString = "{0:n3}";
            this.bandedGridView1.Bands["plan"].Columns.Add(col);

            #endregion
        }