You can do this by doing a couple of things:
Set the
TDBGrid.TitleFont.Orientation
to900
, which is 90 degrees.Use an interposer class to change the
TDBGrid
first (column header) row height. The interposer class gives you access to theRowHeights
property of the grid, which isn't published inTDBGrid
:
implementation type THackGrid=class(TDBGrid); procedure TForm1.FormCreate(Sender: TObject); begin THackGrid(DBGrid1).RowHeights[0] := 300; end;
Calculating the proper height to use for RowHeights[0]
is an exercise left to you. :-) As @TLama said in his comment, you're better off owner-drawing the grid to get the proper fit and alignment of the text; how to do so would be another question (but there are examples that exist already for doing so, so make sure you look at them first before asking it).