• 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;
  • 相关阅读:
    elcascader 联级框动态懒加载数据
    spring boot mybaits dao层配置
    哪些情况下的单例会被破坏
    Oracle收集表统计信息
    BeanFactory与FactoryBean
    详解脏读、幻读与不可重复读
    Redis过期了为什么内存没释放
    为什么不推荐select * from
    InnoDB与MyISAM的区别
    开机时自动运行PowerShell脚本
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940581.html
Copyright © 2020-2023  润新知