老师您好!
我用如下代码将C1combo控件绑定到C1flexgrid某列后,表格中其它列也会出现C1combo控件控件(见附图)
表头我是用代码加载的
C1.Win.C1FlexGrid.CellRange rng = new C1.Win.C1FlexGrid.CellRange();
c1FlexGrid3.Styles.Normal.WordWrap = true;
c1FlexGrid3.Rows.Count = 2;
c1FlexGrid3.Rows.Fixed = 2; //标题行数
c1FlexGrid3.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.FixedOnly;//合并启动
//列
c1FlexGrid3.Cols[0].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 0, 1, 0); //合并区域
rng.Data = "序";
c1FlexGrid3.Cols[0].Name = "fEntryID";
//列
c1FlexGrid3.Cols[1].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 1, 1, 1); //合并区域
rng.Data = "材料代码";
c1FlexGrid3.Cols[1].Name = "fNumber";
//列
c1FlexGrid3.Cols[2].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 2, 1, 2); //合并区域
rng.Data = "材料名称";
c1FlexGrid3.Cols[2].Name = "fName";
//列
c1FlexGrid3.Cols[3].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 3, 1, 3); //合并区域
rng.Data = "批号";
c1FlexGrid3.Cols[3].Name = "batchId";
//列
c1FlexGrid3.Cols[4].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 4, 1, 4); //合并区域
rng.Data = "单位";
c1FlexGrid3.Cols[4].Name = "unitName";
//列
c1FlexGrid3.Cols[5].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 5, 1, 5); //合并区域
rng.Data = "领用量A";
c1FlexGrid3.Cols[5].Name = "needFQty";
c1FlexGrid3.Cols[5].DataType= typeof(decimal);
c1FlexGrid3.Cols[5].Format = "N4";
//列
c1FlexGrid3.Cols[6].AllowMerging = true;
rng = c1FlexGrid3.GetCellRange(0, 6, 1, 6); //合并区域
rng.Data = "产品使用量B";
c1FlexGrid3.Cols[6].Name = "useFQty";
c1FlexGrid3.Cols[6].DataType = typeof(decimal);
c1FlexGrid3.Cols[6].Format = "N4";
c1FlexGrid3.Cols[6].Style = this.c1FlexGrid1.Styles["ColumnColor"];
Column stockInfo = c1FlexGrid3.Cols[6];
stockInfo.Editor = c1ComboStock;
|