TreeList.SetDefaultRowHeight() Method

Activates automatic row height adjustment.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v21.2.dll


public virtual void SetDefaultRowHeight()


The height of rows is specified by the TreeList.RowHeight property. If this property value is -1, row height is determined by the Tree List control automatically. In this case, rows get the minimum height required to fit row contents vertically. This implies that the following row elements must fully display their contents: cells, state and select images, group button. Note that the TreeList.RowHeight property doesn’t affect the height of preview sections.

There may be a situation when different rows have different minimum required heights. This can take place, for instance, if you apply different font sizes to odd and even rows. In this case, rows still get the same height which is enough to fit the highest row contents.

The SetDefaultRowHeight method sets the TreeList.RowHeight property to -1 and, thus, applies the automatic row height adjustment to Tree List rows.

Note: users can apply automatic row height adjustment by a double-click on an indicator cell edge.

See Also