Delphi & C++ Builder components library
and Software development
 
 
 

rDBGrid - how to implement footer row

Footer row is defined by property rDBGrid.FooterRow which can be set easily by design time editor or also by code in runtime. Open documentation page for list of FooterRow properties.

Footer row is shown automatically but calculation of summary values must be ensured in application by calling of procedure RecalculateSummaryResults. It should be called in any time when summary values can be changed:

  • after dataset open
  • after dataset post
  • after dataset delete

Following properties can be also used to ensure automatic calculation:

  • FooterRow.RecalculateAfterOpen - automatic footer recalculation when dataset active change
  • FooterRow.RecalculateAfterFilter - automatic footer recalculation when grid filter change
  • FooterRow.RefreshAfterScroll - automatic footer redraw after scroll (needed only if RecNo is used as summary content)

Procedure RecalculateSummaryResults can take a long time for huge dataset with thousand of records. In this case you can use sql command to calculate result and rDBGrid event OnGetSummaryResult to define result for footer.

Open documentation page.

Go back