Skip to main content
A newer version of this page is available. .

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.v19.1.dll

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
True

Corresponds to a Boolean value of true.

False

Corresponds to a Boolean value of false.

Default

The value is determined by the current object’s parent object setting (e.g., a control setting).

Property Paths

You can access this nested property as listed below:

Library Object Type Path to ColumnHeaderAutoHeight
WinForms Controls ResourcesTree
.OptionsView.ColumnHeaderAutoHeight
TreeList
.OptionsView.ColumnHeaderAutoHeight
Reporting XRDesignFieldList
.OptionsView.ColumnHeaderAutoHeight
XRDesignReportExplorer
.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";
See Also