zoukankan      html  css  js  c++  java
  • DevExpress 同一个窗体多个表格

    多个表格使用相同列信息时,需要分别添加列信息,不能使用同一个列对象,再创建一个新对象进行添加,否则只能操作一个表格信息

    int index = 0;
                List<GridColumn> ColumnList = new List<GridColumn>();
                ColumnList.Add(new GridColumn() { VisibleIndex = index++, Width = 150, FieldName = "CinemaName", Caption = "影院", Name = "CinemaName", Fixed = FixedStyle.Left });
                ColumnList.Add(new GridColumn() { VisibleIndex = index++, Width = 80, FieldName = "City", Name = "City", Caption = "城市", Fixed = FixedStyle.Left });
                ColumnList.Add(new GridColumn() { VisibleIndex = index++, Width = 80, FieldName = "PointCode", Name = "PointCode", Caption = "点位编号", Fixed = FixedStyle.Left });
                ColumnList.Add(new GridColumn() { VisibleIndex = index++, Width = 60, FieldName = "PointType", Name = "PointType", Caption = "点位类型" });
                ColumnList.Add(new GridColumn() { VisibleIndex = index++, Width = 60, FieldName = "MediaType", Name = "MediaType", Caption = "媒体形式" });
                foreach (GridColumn item in ColumnList)
                {
                    if (item.Name != "CinemaName")
                    {
                        item.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
                    }
                    gridView1.Columns.Add(item);
    
                    GridColumn col = new GridColumn()
                    {
                        VisibleIndex = item.VisibleIndex,
                        Width = item.Width,
                        FieldName = item.FieldName,
                        Caption = item.Caption,
                        Name = item.Name,
                        Fixed = item.Fixed
                    };
                    col.OptionsColumn.AllowMerge = item.OptionsColumn.AllowMerge;
                    gridView2.Columns.Add(col);
                }
  • 相关阅读:
    责任链模式(Chain of Responsibility)
    模板模式(Template Method)
    组合模式(Composite Pattern)
    原型模式(Prototype Pattern)
    策略模式(Strategy Pattern)
    状态模式(State Pattern)
    增删改查
    安卓sql
    安卓第三次作业
    安卓第四周作业
  • 原文地址:https://www.cnblogs.com/tian2008/p/8308940.html
Copyright © 2011-2022 走看看