• 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);
                }
  • 相关阅读:
    批量执行工具PSSH详解
    详解IPTABLES
    nginx启动脚本
    ansible离线安装
    Linux性能评估工具
    Python中路径操作
    mongodb Enable Auth
    MySQL配置参数说明
    redis未授权访问
    php反序列化笔记
  • 原文地址:https://www.cnblogs.com/tian2008/p/8308940.html
Copyright © 2020-2023  润新知