BaseListBoxControl.ItemAutoHeight Property

Gets or sets whether the height of items is automatically calculated to fit their entire content.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DefaultValue(false)]
[DXCategory("Layout")]
public bool ItemAutoHeight { get; set; }
<DefaultValue(False)>
<DXCategory("Layout")>
Public Property ItemAutoHeight As Boolean

Property Value

Type Default Description
Boolean

false

true, if item height is automatically calculated; otherwise, false.

Remarks

By default, all items have the same height, determined by the control's font. You can set a custom item height using the BaseListBoxControl.ItemHeight property or BaseListBoxControl.MeasureItem event.

Some items may have lengthy display text. To wrap the text, enable the word-wrapping feature using the BaseListBox.Appearance.TextOptions.WordWrap property and set the ItemAutoHeight property to true. In this case, the item height is automatically calculated to fit the entire text. As a result, different items may have different heights.

If the ItemAutoHeight property is enabled, the BaseListBoxControl.ItemHeight property can only be used to explicitly increase the automatically calculated height.

NOTE

The ItemAutoHeight property is not supported when listbox items are rendered based on item templates. In this rendering mode, item height can be specified with the BaseListBoxControl.ItemHeight property or BaseListBoxControl.MeasureItem event.

See Also