• AdvBandedGridView备忘


    昨天写了一个做东西时,用到AdvBandedGridView,留下自已写的示例代码以做备忘。

    东西很简单,只有一个属性需要注意:c1.Visible = true;

    AdvBandedGridView例子

                //实例化GridControl和AdvBandedGridView
                this.gridControl1 = new DevExpress.XtraGrid.GridControl();
                this.advBandedGridView1 = new DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView();
                this.gridControl1.ViewCollection.Add(this.advBandedGridView1);
    
                this.gridControl1.Location = new System.Drawing.Point(3, 39);
                this.gridControl1.MainView = this.advBandedGridView1;
                this.gridControl1.Name = "gridControl1";
                this.gridControl1.Size = new System.Drawing.Size(653, 443);
                this.Controls.Add(this.gridControl1);
                
                this.advBandedGridView1.GridControl = this.gridControl1;
                this.advBandedGridView1.Name = "advBandedGridView1";
    
                //创建列
                BandedGridColumn c1 = this.advBandedGridView1.Columns.Add(); //this.advBandedGridView1.Columns.Add();
                c1.Caption = "列QQ1";
                c1.Visible = true;
                BandedGridColumn c2 = new BandedGridColumn();
                c2.Caption = "列2";
                c2.Visible = true;
                BandedGridColumn c3 = new BandedGridColumn();
                c3.Caption = "列3";
                c3.Visible = true;
                BandedGridColumn c4 = new BandedGridColumn();
                c4.Caption = "列4";
                c3.Visible = true;
                this.advBandedGridView1.Columns.AddRange(new BandedGridColumn[] { c1, c2, c3, c4 });
    
                //创建Band
                GridBand b1 = new GridBand();//this.advBandedGridView1.Bands.AddBand("MyBand1");为什么AddBand是错误的?
                b1.Caption = "我的1组";
                GridBand b2 = new GridBand();
                b2.Caption = "我的2组";
                GridBand b3 = new GridBand();
                b3.Caption = "我的3组";
                this.advBandedGridView1.Bands.AddRange(new GridBand[] { b1, b2, b3});
    
                //为Band添加列
                b1.Columns.Add(c1);
                b1.Columns.Add(c2);
                b2.Columns.Add(c3);
                b2.Columns.Add(c4);
  • 相关阅读:
    @override报错
    idea快捷键
    java中getAttribute与getParameter的区别
    localStorage基于浏览器的本地存储
    js画布组件(<canvas></canvas>)
    easyui
    关于Bootstrap
    使用layUI美化的登录功能
    EXT JS
    ★一些文章链接
  • 原文地址:https://www.cnblogs.com/shi5588/p/2703346.html
Copyright © 2020-2023  润新知