It AutoRowHeight() there's the error that StringGrid.RowHeights[ARow] is assigned to h, it should use hmax instead.
In the attachment you find a demo which is basd on this (corrected) sample code and shows the correct behavior.
'Fits like a glove' ^^
I've tryed to change that StringGri1 of the first code for AGrid and give the parameters, but I got a SigSev Error when (where) I call the function, so I gave up, since I didn't enough time in that moment to find what's wrong.
Another ideia that I had (not sure if will work) is just to count the number of LineEndings of the cell and them create a * like you have in your code, based on the font size, it should be something like: (Font) 12 * 4 (Parag), but something I've noticed is the fact that I need to run it for each line and problably will not work with multiple collumns, it's something to let quiet for now.
But once more, a big thanks very much.
The Font Size * Paragraph Count code sketch:
procedure TfrmMain.buttonClick(Sender: TObject);
var
test : String;
sl : TStringList;
counter : Integer;
begin
text := 'Line 1'+LineEnding+LineEnding+'Line 2'+LineEnding+'Line 3';
sl := TStringList.Create;
counter:=ExtractStrings([LineEnding], [' '], PChar(text), sl);
//# the rest of the code to get the cell (line) font size then * for the counter (I didn't finish) and them transfer the result to the cell (line) Height
end;