I've got rather long string
in from a query and I like it to be seen full in TDBGrid.
So I need:
Part 1) Make cells of certain column multistring
Part 2) Make rows autosizeable (depending on strings count).
For 1) I used PrepareCanvas:
procedure TfrmMain.gridDetPrepareCanvas(sender: TObject; DataCol: Integer;
Column: TColumn; AState: TGridDrawState);
var
ItemsTextStyle: TTextStyle;
begin
with (sender as TDBGrid) do
begin
if (DataCol=2) then begin
ItemsTextStyle:= Canvas.TextStyle;
ItemsTextStyle.SingleLine:=false;
ItemsTextStyle.WordBreak:=true;
Canvas.TextStyle:=ItemsTextStyle;
end;
end;
end;
Now there is a multistring text in rows with old height for 1-string text.
How should I solve part 2?