The examples contained in Tee.Grid.Totals are not compilable, they seem developed for older versions of TTeeGrid.
In both examples the compiler gives the following error [dcc32 Error] : E2034 Too many actual parameters
// Return a new Totals grid-band
function Totals(const ACollection:TCollection):TColumnTotals;
begin
result:=TColumnTotals.Create(ACollection);
result.Calculation.Add('Name',TColumnCalculation.Count);
result.Calculation.Add('Children',TColumnCalculation.Sum);
result.Calculation.Add('Height',TColumnCalculation.Average);
result.Calculation.Add(result.Columns['Address'].Items['Number'],TColumnCalculation.Max);
result.Format.Font.Style:=[fsBold];
end;
The syntax/overload you referenced also works ok in this demo.
ie.
The key to the difference seems to be the use of “tmp as TColumnTotals”, rather than calling “TeeGrid1.Totals” (unfound by the compiler). I’ll look around for examples; that may be old syntax as you suggest or simply an error where we have it included in documentation. We’ll change examples we find for the new syntax.