Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 20 Apr 2024, 05:10

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 12 Apr 2023, 02:24 
Offline

Joined: 23 Jan 2021, 01:58
Posts: 6
As the question, how to get the value of Footer under the group within the group.
My version is trial version 11.0


Top
 Profile  
 
PostPosted: 12 Apr 2023, 17:04 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Do you mean when the DBGridEh.DataGrouping.Active = True?


Attachments:
sshot-312.png
sshot-312.png [ 29.59 KiB | Viewed 1578 times ]

_________________
Best regards
EhLib Support Team
Top
 Profile  
 
PostPosted: 15 Apr 2023, 01:57 
Offline

Joined: 23 Jan 2021, 01:58
Posts: 6
EhLibSupport wrote:
Do you mean when the DBGridEh.DataGrouping.Active = True?


Yes, how do I get it please?


Top
 Profile  
 
PostPosted: 17 Apr 2023, 13:51 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

The value of the footer depends on which grouping row you are on in the grid.
If you want to get the footer value for the current grouping row for the PartPrice column, you can use the following code:

Code:
procedure TfrDataGrouping.Button1Click(Sender: TObject);
var
  ColIndex: Integer;
  FooterVal: Variant;
  GroupNodeRow: TGroupDataTreeNodeEh;
begin
  GroupNodeRow := DBGridEh1.DataGrouping.CurDataNode;
  if (GroupNodeRow.NodeType <> dntDataGroupEh) then
  begin
    ShowMessage('Current row is not group caption');
    Exit;
  end;

  ColIndex := DBGridEh1.FieldColumns['PartPrice'].Index;
  FooterVal := GroupNodeRow.FooterItems[0].FooterValues[ColIndex];
  ShowMessage(VarToStr(FooterVal));
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 18 Apr 2023, 05:41 
Offline

Joined: 23 Jan 2021, 01:58
Posts: 6
EhLibSupport wrote:
Hello

The value of the footer depends on which grouping row you are on in the grid.
If you want to get the footer value for the current grouping row for the PartPrice column, you can use the following code:

Code:
procedure TfrDataGrouping.Button1Click(Sender: TObject);
var
  ColIndex: Integer;
  FooterVal: Variant;
  GroupNodeRow: TGroupDataTreeNodeEh;
begin
  GroupNodeRow := DBGridEh1.DataGrouping.CurDataNode;
  if (GroupNodeRow.NodeType <> dntDataGroupEh) then
  begin
    ShowMessage('Current row is not group caption');
    Exit;
  end;

  ColIndex := DBGridEh1.FieldColumns['PartPrice'].Index;
  FooterVal := GroupNodeRow.FooterItems[0].FooterValues[ColIndex];
  ShowMessage(VarToStr(FooterVal));
end;



Thank you very much, it solved my problem


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group