问题如题所述,具体的请访问:http://www.delphibbs.com/keylife/iblog_show.asp?xid=6469
    这里不能贴图,只好放到大富翁笔记上了 .

解决方案 »

  1.   

    http://www.delphibbs.com/keylife/iblog_show.asp?xid=6469
    上面的地址,进去后显示“系统维护中...”
    //////////////////////
    楼主说说你要实现什么
      

  2.   

    var
      a: TcxCustomGridRow;
      i: integer;
    begin
      for i := 0 to cxGrid1DBTableView1.ViewData.RowCount - 1 do
      begin
        a := cxGrid1DBTableView1.ViewData.Rows[i];
        if a is TcxGridGroupRow then
          showmessage(TcxGridGroupRow(a).DisplayText);
      end;
    end;
    TcxGridGroupRow的相关的属性:
    DisplayText: string  
    //'发行年份:2002(发行电影数:1,合计放映长度:106分钟)'
    DisplayTexts: array of string 
    //有问题,因为DisplayTexts[i],不管i为何值,它始终是 '2002 
    Value: Variant 
    //2002  
    ValueCount: integer
    //3  //(表示分组中显示了三个值)
    Values: array of Variant 
    //有问题,因为Values[i],不管i为何值,它始终是 2002
    /////////////////////////////////////////////////////////
    所以建议楼主使用DisplayText和ValueCount,利用字符串函数取值吧!////////////////////////////////////////////////
    问一下楼主“合计值 106 ”你是用什么方法取到。
      

  3.   

    dulei115:
           我想如果真的不能直接取得的所需值的话,也只能取组显示的所有字符串,然后处理字符串了,跟你说差不多.不过我都是通过DataController.Summary属性中的属性或方法实现的,
    你问的问题可以通过DataController.Summary.GroupSummaryValues属性获得的.
       至今还没找到完全解决的办法,你有QQ号吗?QQ上讨论如何?我的是:35715009.
       谢谢!
          
      

  4.   

    有,但是不上,容易上瘾,浪费时间!
    //////////////////////////////////
    我试试DataController.Summary.GroupSummaryValues先!
      

  5.   

    搞不懂DataController.Summary.GroupSummaryValues的三个参数,cxGrid自带的帮助里面也没有GroupSummaryValues的说明
      

  6.   

    帮助里面有啊
       property GroupSummaryValues[DataGroupIndex: TcxDataGroupIndex; Index: Integer]: Variant
       按我的了解,DataGroupIndex就是组中的Index值,相当于分组后组对应的行数啦,Index就是Summary的Groups中的Items的Index值:
    如:GroupSummaryValues[0,1]:值就是组中第一行的合计值:106
       GroupSummaryValues[0,0]:就是组中第一行的电影数值:1如果懂得记录的行数,好像GroupSummaryDisplayValues[RowIndex, Level, Index: Integer]更好用哦,它的第一个参数对应的就是RowIndex.  
      

  7.   

    对于GroupSummaryDisplayValues有个问题:
    for i := 0 to cxGrid1DBTableView1.ViewData.RowCount - 1 do
      for j := 0 to *LevelCount* - 1 do
        for k := 0 to *IndexCount* - 1 do
          //use cxGrid1DBTableView1.DataController.Summary.GroupSummaryDisplayValues[i, j, k]
    上面的*LevelCount*,*IndexCount*分别应该是什么
      

  8.   

    真高兴,今天终于解决问题了,感谢各位的热心帮助,特别的谢谢dulei115.dulei115:    
       弄明白了吗? 我的理解是 你代码中的 j 就是 表格中的层次,如最外面的层为0层,越往里层值越大,k 就是Summary.Groups.Items的Index值啦,其实可以去看一下它的帮助的了,挺详细的.要不看看http://www.delphibbs.com/keylife/iblog_show.asp?xid=6469上传的图片,其实就是帮助上的啦.
       越来越发现TcxGrid的强大了.呵.
       
      

  9.   

    dulei115:
        在DataController.Groups中有个属性DataGroupIndexByRowIndex可以把RowIndex转换成
    DataGroupIndex,这样你就可以直接用GroupSummaryDisplayValues获取相应的值了,可以不用理会Level了,因为一般都只分一个组,也就只有一层.