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;

cxgrid动态多表头的更多相关文章

  1. cxGrid动态设置单元格对齐方式

    cxGrid动态设置单元格对齐方式 2013年10月08日 00:52:49 踏雪无痕 阅读数:2150更多 个人分类: cxGrid   判断: //uses cxTextEditcxGrid1DB ...

  2. cxgrid动态生成footersummary 并获得值

    cxgrid动态生成footersummary 并获得值   var f: TcxGridDBTableSummaryItem; cx_for_mctv.OptionsView.Footer := t ...

  3. cxgrid动态创建列

    cxgrid动态创建列 procedure TFrmRuleEdit.CreateCols;varColumn: TcxGridDBColumn;begincdsPowerPrj.First;whil ...

  4. 浅谈js中如何动态添加表头/表列/表格内容

    我想很多童鞋用js动态向表格中添加数据很熟悉,而且也觉得非常简单!是的,对于写页面的童鞋来说,最喜欢写查询的页面了,动态向表格绑定数据.用for循环就可以轻松搞定. 如果我们的业务需求有所变化,可能我 ...

  5. element-ui的table动态生成表头和数据,且表中数据可编辑

    1.实现表头的动态渲染 2.表头label和prop字段都要定义 3.去判断显示那个数据表 4.实现双击的时候在可编辑 // 双击修改 弹出input tableDbEdit(row, column, ...

  6. easyui tree datagrid动态添加表头和表格数据,动态弹出框,修改和删除按钮

    1.要有获取表头的URL和表格的URL 背景:点击树的一个节点,就加载一个表格,这个表格是动态的,表头和表格数据都是动态的 解决方案:需要两个URL,一个是获取表头的URL,一个是获取表格数据的URL ...

  7. element动态添加表头的正确姿势

    1. 第一步循环 el-table-column <el-table-column v-if="item.show" v-for="(item, index) in ...

  8. ExtJs如何使用自定义插件动态保存表头配置(隐藏或显示)

    关于保存列表表头的配置,一般我们不需要与后台交互,直接保存在 localStorage 中就能满足常规使用需求(需要浏览器支持). 直接上代码,插件: Ext.define('ux.plugin.Co ...

  9. easyui datagrid怎么动态获取表头的列名及显示名称

    说明:目前使用easyui combobox多选属性,绑定的数据源是来自datagrid的表头的列名及显示名称 处理方法: //获取冻结的数据源并返回key,value格式数据 var GetFroz ...

随机推荐

  1. [ES]elasticsearch章3 ES写入过程解析

    Elasticsearch的写 Elasticsearch采用多Shard方式,通过配置routing规则将数据分成多个数据子集,每个数据子集提供独立的索引和搜索功能.当写入文档的时候,根据routi ...

  2. NServiceBus消息重播

    https://docs.particular.net/tutorials/message-replay/ 链接:https://pan.baidu.com/s/1KdWvpfZYZ2wUivkt3B ...

  3. IntelliJ IDEA 配置svn

    1.启用版本控制 2.在弹出的框中选择svn 3.下载并解压VisualSVN  下载地址:http://subversion.apache.org/packages.html#windows 4.i ...

  4. sqlserver 添加服务器链接 跨服务器访问数据库

    转载地址1:https://www.cnblogs.com/wanshutao/p/4137994.html //创建服务器链接 转载地址2:https://www.cnblogs.com/xulel ...

  5. AnsiToUtf8 和 Utf8ToAnsi

    在服务端数据库的处理当中,涉及中文字符的结构体字段,需要转为Utf8后再存储到表项中.从数据库中取出包含中文字符的字段后,如果需要保存到char *类型的结构体成员中,需要转为Ansi后再保存.从数据 ...

  6. PHP 写文件的例子

    $contents = "All the content"; $dir = 'c:'; $file_path = $dir . "\\content.txt"; ...

  7. spring boot所有配置

    转载 http://blog.csdn.net/lpfsuperman/article/details/78287265 # 日志配置# 日志配置文件的位置. 例如对于Logback的`classpa ...

  8. MySQL把本地数据库上传到linux

    今天是要导入数据库到linux系统 先用Navicat把sql导出,然后登陆到linux去执行 登陆mysql: mysql -uroot -p123456 创建数据库:create database ...

  9. 进制转换(NOIP2000&NOIP水题测试(2017082301))

    题目链接:进制转换 这题得明白其中的数学方法,明白后就不难了. 那么我们应该怎么计算呢? 其实也很简单. 我们依然采取辗转相除法. 但是,对于负的余数,我们需要进行一些处理. 我们怎么处理呢? 很简单 ...

  10. 811. Subdomain Visit Count

    这题主要难在构建关联容器,方法很多,但是核心都是把原字符串一截一截减下来处理,先把前面用空格隔开的次数转化为整数,然后处理后面的多层子域. 方法一,查找标志字符,用标志字符把字符串分成几段 stati ...