EhLib
ContentsIndexHome
PreviousUpNext
Customizing grid footer

Footers and total values. 

TDBGridEh can display special row (footer) or rows at bottom part. Use FooterRowCount property to specify the number of footer rows in the grid. Use Footer or Footers property of TColumnEh object to specify information which needs to show in footer cells. Footers property is useful when you have more than one footer rows. Footers are a collection of TColumnFooterEh objects. Information from i-th element of collection will be shown in i-th row of footer. In footer cell, it is possible to show: Sum value for the specific field, records count, the value of a specific field or static text. Use property Footer.ValueType or Footers[i].ValueType to specify which type of value will be shown in the footer cell. If ValueType = fvtStaticText, then you also need to set Value property to specify text which will be shown. If ValueType = fvtFieldValue, then you need to set property FieldName to specify the field, value of which will be shown. To force grid to calculate total values you need to activate SumList (Set DBGridEh.SumList.Active to True value). 

Set TColumnFooterEh.ValueType to fvtSum to show sum value of the column field in the footer cell, you can also specify Column.Footer.FieldName to calculate total value of the other field. Set ValueType to fvtCount to force grid to display count of records in the footer cell. 

Use the sub-properties of property TDBGridEh.FooterParams to customize the footer of the grid.

Property name 
Property type 
Description 
Color 
TColor 
Specifies the background color for the footer color. 
FillStyle 
TGridCellFillStyleEh 
Specifies the style of filling the footer cells. 
Font 
TFont 
Controls the font in which the title cells displays its data. 
ParentFont 
Boolean 
Determines where a control looks for its font information. 
RowHeight 
Integer 
Specifies the height of footer row in pixels. 
RowLines 
Integer 
Specifies the height of footer row in text lines.
Full row height = height in pixels of RowLines + RowHeight. 
HorzLineColor 
TColor 
Color of the horizontal lines in the footer area. 
HorzLines 
Boolean 
Presence of horizontal lines in the footer area. 
VertLineColor 
TColor 
Color vertical lines in the footer area. 
VertLines 
Boolean 
Presence of vertical lines in the footer area. 
Copyright (c) 1998-2013. All rights reserved.
What do you think about this topic? Send feedback!