3

I want to create a TDBGrid descendant with a footer to summarize columns. Can you point me to the steps to create a footer bar and populate it by the columns ?. Maybe there is some open-source grid with footers where I can look its code ?.

Thank you.

Marc Guillot
  • 6,090
  • 1
  • 15
  • 42
  • Hi @Marc. I suggest you take a look at [this answer](https://stackoverflow.com/a/10483615/2663863), which talks about a footer add-on to the Jedi TJvDBGrid. – MartynA Feb 22 '21 at 16:52
  • Thanks @MartynA. That's perfect, I wanted to take a look to an open-source grid to see how they do it. – Marc Guillot Feb 22 '21 at 16:59
  • May be the best way is to put a component (TMemo..) at the bottom of the DBGrid and fill it with a summary – philnext Feb 22 '21 at 17:18

1 Answers1

3

The JEDI project's visual component library contains a highly-customizable DB grid, TJvDBGrid and there is an add-in component for this, TJvDBGridFooter which I expect is very close to what you are looking for.

There is outline documentation for the TJvDBGridFooter here: https://wiki.delphi-jedi.org/wiki/Category:TJvDBGridFooter which is pretty minimal but should suffice to indicate whether it is likely to meet, or be adaptable to, your needs.

You'll find the source of the TJvDBGrid and TJvDBGridFooter components in the JvDBGrid.Pas and JvDBGridFooter.Pas files, respectively, in the Run folder of the standard JVCL install.

Btw, TJvDBGrid is a descendant of the VCL's TCustomDBGrid.

MartynA
  • 30,454
  • 4
  • 32
  • 73