Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 29 Mar 2024, 15:41

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Create Footer at runtime
PostPosted: 22 Oct 2022, 15:10 
Offline

Joined: 13 Jun 2012, 14:17
Posts: 15
Hi,
I want to create a Footer for a Column at runtime at set the Parameter ValueType. How can I do this?

The following code didn't work:
AGrid.FieldColumns[AFieldName].Footers.Create(AGrid.FieldColumns[AFieldName],TColumnFooterEh);
AGrid.FieldColumns[AFieldName].Footers.Items[0].ValueType := fvtStaticText;

Thank for help!

Michael


Top
 Profile  
 
PostPosted: 24 Oct 2022, 08:59 
Offline

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

If you have one row for a footer you can use TColumnEh.Footer property

Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGridEh1.FieldColumns['Area'].Footer.ValueType := fvtStaticText;
  DBGridEh1.FieldColumns['Area'].Footer.Value := 'Static Text';
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 06 Dec 2023, 15:05 
Offline

Joined: 29 Oct 2013, 11:58
Posts: 13
EhLibSupport wrote:
Hello

If you have one row for a footer you can use TColumnEh.Footer property

Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGridEh1.FieldColumns['Area'].Footer.ValueType := fvtStaticText;
  DBGridEh1.FieldColumns['Area'].Footer.Value := 'Static Text';
end;


what about multiples rows footer ?


Top
 Profile  
 
PostPosted: 07 Dec 2023, 12:01 
Offline

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

If you have multiple footer rows (FooterRowCount > 0)
then to set the values in each footer cell you need to use a TColumnEh.Footers collection

Like this

Code:
  with DBGridEh1.FieldColumns['Population'].Footers.Add do
  begin
    ValueType := fvtSum;
  end;
  with DBGridEh1.FieldColumns['Population'].Footers.Add do
  begin
    ValueType := fvtCount;
  end;

_________________
Best regards
EhLib Support Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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