Customizing the Grid's Appearance > Row Height and Multiple-line Displays > Adjusting the height of all grid rows |
You can configure the row height interactively at design time by placing the grid in its visual editing mode or by changing the grid's RowHeight property on the General property page. At run time, the user can adjust the row height interactively if AllowRowSizing is True. For more information, see Run Time Interaction.
The RowHeight property is expressed in units of the container's coordinate system. However, a setting of 0 causes the grid to readjust its display so that each row occupies a single line of text in the current font. Therefore, you can use the following code to adjust the row height to display exactly three lines of text:
TDBGrid1.RowHeight = 0
TDBGrid1.RowHeight = 3 * TDBGrid1.RowHeight
This technique is particularly effective when displaying multiple-line memo fields, as in this example.
Note that the Description column must have its WrapText property set to True; otherwise, the memo field display will be truncated after the first line.