Skip to content

piHeaderHeightMultiplier - cCJGrid

Can be used to adjust the height of the grid's header section allowing more than one line of text in the header section for each column

Type: Property
Access: Read/Write
Data Type: Integer
Parameters: None

Syntax

Property Integer piHeaderHeightMultiplier
Access Type Syntax
Read Access: Get piHeaderHeightMultiplier to IntegerVariable
Write Access: Set piHeaderHeightMultiplier to IntegerVariable/Value

Description

This property can be used to adjust the height of the grid's header section, allowing more than one line of text in the header section for each column.

When the property is set to -1 (the default), the header height is determined by the Grid control. This is determined by the header font. If pbMultiLine is true for a grid column, then the header height is dynamic and may grow when the header text wraps to a new line.

When this property is >1, then the default header height will be multiplied by the value of this property. e.g. if piHeaderHeightMultiplier = 2, then the header will high enough for 2 lines of text.

If you want a column's header text to wrap across multiple lines, then you must also set the column's peHeaderAlignment to xtpAlignmentWordBreak.

If you combine piHeaderHeightMultiplier and pbMultiLine, then you will get strange results. The default header height will change to fit the multiple lines of text and then this height will be multiplied by piHeaderHeightMultiplier. This means that, when a multi line column sets the default header height to 2 lines and piHeaderHeightMultiplier = 2, then the actual header height will enough for 4 lines of text. Usually, you should not use piHeaderHeightMultiplier when pbMultiLine is true for any column in the grid.

If you want to have header text over multiple lines, then use piHeaderHeightMultiplier in preference to the column object's pbMultiLine property, as pbMultiLine does not use the fixed row height painting algorithim and thus is much slower.