zoukankan      html  css  js  c++  java
  • cxgrid动态多表头

    function TForm15.CreateBand(View: TcxGridDBBandedTableView;
      BandCaption, ParentBandCaption: String): TcxGridBand;
    var
      band: TcxGridBand;
    begin
      Result := nil;
      if View = nil then exit;
      if ParentBandCaption <> '' then
        band := FMyList.Objects[FMyList.IndexOf(ParentBandCaption)] as TcxGridBand;
      Result := view.Bands.Add;
      with Result do
      begin
        Caption := BandCaption;
        if (BandCaption <> '') and (ParentBandCaption <> '') and (BandCaption <> ParentBandCaption) then
        begin
          Position.ColIndex := band.ColumnCount + 1;
          Position.BandIndex := band.Index;
        end else if (BandCaption = '') and (ParentBandCaption = '') then
        begin
          Position.ColIndex := FRootBandCount + 1;
          Position.BandIndex := -1;
          FMyBand := Result;
        end else begin
          Position.ColIndex := FRootBandCount + 1;
          Position.BandIndex := -1;
        end;
      end;
    end;
    function TForm15.CreateCol(View: TcxGridDBBandedTableView; FieldName: string;
      BandCaption: string): TcxGridDBBandedColumn;
    var
      band: TcxGridBand;
    begin
      result := nil;
      if View = nil then Exit;
      if FieldName = '' then exit;
      if BandCaption = '' then Exit;
      band := FMyList.Objects[FMyList.IndexOf(BandCaption)] as TcxGridBand;
      Result := View.CreateColumn;
      with Result do
      begin
        DataBinding.FieldName := FieldName;
        Position.ColIndex := band.ColumnCount + 1;
        Position.BandIndex := band.Index;
      end;
    end;
  • 相关阅读:
    JS中短路运算符&&和||
    jadx 调整jvm参数
    python 面向对象(进阶篇)
    Python 面向对象(初级篇)
    python+requests接口自动化测试实战
    Jmeter-接口压测
    敬请指正-我进行单元测试的分享
    现在的开发都要懂测试了,为什么?这一份书单告诉你!
    你不得不看-自动化测试工程师面试总结:技术面试
    web自动化快速使用
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940581.html
Copyright © 2011-2022 走看看