Skip to main content

TreeListOptionsView.ColumnHeaderAutoHeight Property

Gets or sets whether the column header height is automatically adjusted to fit wrapped column captions.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.1.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

[DefaultValue(DefaultBoolean.Default)]
[XtraSerializableProperty]
public virtual DefaultBoolean ColumnHeaderAutoHeight { get; set; }

Property Value

Type Default Description
DefaultBoolean Default

A value that specifies whether the column header height is automatically adjusted to fit wrapped column captions.

Available values:

Name Description Return Value
True

The value is true.

0

False

The value is false.

1

Default

The value is specified by a global option or a higher-level object.

2

Property Paths

You can access this nested property as listed below:

Object Type Path to ColumnHeaderAutoHeight
TreeList
.OptionsView .ColumnHeaderAutoHeight

Remarks

If the ColumnHeaderAutoHeight property is set to Default or False, column captions (the TreeListColumn.Caption property) are trimmed if they do not fit the column width. The following image demonstrates the TreeList with two trimmed column captions.

TreeListColumnHeaderAutoHeightFalse

To automatically wrap column captions whose length exceeds the corresponding column width, set the ColumnHeaderAutoHeight property to True. The column header panel height will be automatically adjusted to fit wrapped captions. Ensure that the TextOptions.WordWrap options (accessible from the TreeListAppearanceCollection.HeaderPanel and TreeListColumn.AppearanceHeader properties) are not set to NoWrap.

TreeListColumnHeaderAutoHeightTrue

In auto-height mode, you can increase the automatically calculated column header height by setting the TreeList.ColumnPanelRowHeight property. If this property value is -1 or less than the value required to accommodate column captions, the TreeList.ColumnPanelRowHeight property is not in effect.

You can force a caption to be wrapped at a specific position. For instance, using the <br> HTML tag (if the TreeListOptionsView.AllowHtmlDrawHeaders property is enabled) or using the Environment.NewLine property when setting a column caption allow you to split the caption into multiple lines.

treeList.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
treeList.OptionsView.AllowHtmlDrawHeaders = true;
colSeptemberSales.Caption = "September<br>Sales";

Tip

Use the TreeList.ViewInfo.ColumnPanelHeight property to obtain the height of column headers.

See Also