Ticket Q201712
Visible to All Users

How can i get Footer Summary Values by Column Summary Index in cxGrid

created 16 years ago

Hello;
procedure TForm1.ButtonClick(Sender: TObject);
var
  x: real;
begin
  x:= cxGrid1DBTableView1.DataController.Summary.FooterSummaryValues[0];
end;
i can get a summary value by this way. But i think this way is not healthy.
Can i get footer summary value by column summary index
ex: cxGrid1DBTableView1.DataController.Summary.FooterSummaryValues[CxGridColumn1.SummaryIndex];
Thanks for your relation;
Best Regards.

Answers

created 16 years ago

Hello Yusuf.
Thank you for your message. To get a footer summary value by a column, use the following code:

Delphi
AIndex := <aView>.DataController.Summary.FooterSummaryItems.IndexOfItemLink(AColumn); AValue := <aView>.DataController.Summary.FooterSummaryValues[AIndex];

Attached is an example that demonstrates how to perform this task.
Please try this solution and inform us about your results.
Best regards, Ingvar.

    Comments (2)

      Hello,

      Delphi
      var   AIndex: integer;   AValue: variant; begin  with cxGrid1DBTableView1.DataController.Summary do     begin       AIndex :=  DefaultGroupSummaryItems.IndexOfItemLink(cxGrid1DBTableView1DBColumn2);       AValue :=  DefaultGroupSummaryValues[AIndex]     end;   pplabel6.Caption := VarToStr(AValue);

      It gives an error "Undeclared identifier: 'DefaultGroupSummaryValues'"

      Thanks for your relation;Best Regards.

      DevExpress Support Team 11 years ago

        Hello Fatih,

        This is caused by the fact that there is no such property as DefaultGroupSummaryValues. However, I suggest you use the following way to work with group summaries:

        Delphi
        var   AIndex, AGroupIndex: integer;   AValue: variant; begin   with <AcxGridDBTableView>.DataController do   begin     AGroupIndex := Groups.DataGroupIndexByRowIndex[<ARowIndex>];     AIndex := Summary.DefaultGroupSummaryItems.IndexOfItemLink(<AColumn>);     AValue := Summary.GroupSummaryValues[AGroupIndex, AIndex];   end;   Caption := VarToStr(AValue); end;

        I hope that this information helps.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.