group summary中产生的合计,怎么样和列对齐。

解决方案 »

  1.   

    group head还是group foot?
      

  2.   

    eh控件可以实现cxGrid这样的group by功能吗?
      

  3.   

    使用group footer如何能比较美观。
      

  4.   

    cxGrid1DBTableView1.OptionsView.GroupFooters:=gfVisibleWhenExpanded;//在不展开时不显示groupfooter,不会多占一行
      cxGrid1DBTableView1.DataController.Summary.DefaultGroupSummaryItems[0].Position:=spfoot;//在groupfooter显示 
      

  5.   

    老兄:
    获取当前footer合计值,并指定其值用哪个属性?
      

  6.   

    //在cxGrid1DBTableView的OnCustomDrawGroupCell事件中添加如下代码,可以让合计和列对齐,但是不美观。
     var
      FBounds: TRect;
      i:integer;          //在groupheader显示水平位置
      s:string;           //显示string
    begin
      s:=aviewinfo.Text;
      FBounds := AViewInfo.Bounds;
      ACanvas.FillRect(FBounds);
      i:=-50;                        //调整位置
      InflateRect(FBounds,i , 0);     //显示位置
      ACanvas.DrawTexT(copy(s,1,pos('(',s)-1),FBounds, cxWordBreak or cxShowEndEllipsis);
      s:=copy(s,pos('=',s)+1,maxint);   //字符串
      i:=(cxgrid1.Left+cxGrid1DBTableView1ID.Width+cxGrid1DBTableView1MID.Width
        +cxGrid1DBTableView1COMID.Width)*-1;
      InflateRect(FBounds,i , 0);
      ACanvas.DrawTexT(copy(s,1,pos('SUM',s)-3),FBounds, cxWordBreak or cxShowEndEllipsis);
      ADone := True;
    end;
      

  7.   

    搞定了,只是为什么cxGrid会自动展开,还是不明白