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.
How can i get Footer Summary Values by Column Summary Index in cxGrid
Answers
Hello Yusuf.
Thank you for your message. To get a footer summary value by a column, use the following code:
DelphiAIndex := <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.
Hello,
Delphivar
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.
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:
Delphivar
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.