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.