Skip to main content

RepositoryItemComboBox.ItemAutoHeight Property

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

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue(false)]
[DXCategory("Behavior")]
public virtual bool ItemAutoHeight { get; set; }

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, sufficient to display a single line of text using the current font settings. By enabling the ItemAutoHeight property, you allow items to have different heights, each of which corresponds to the particular item content. For instance, this property may be useful if items have different a number of text lines.

comboBoxEdit1.Properties.ItemAutoHeight = true;
comboBoxEdit1.Properties.Items.Add("1st item");
comboBoxEdit1.Properties.Items.Add("2nd item\r\n2nd item");

RepositoryItemComboBox_ItemAutoHeight

If the automatic height calculation does not feet your needs, you can also set custom heights to particular items by handling the RepositoryItemComboBox.MeasureItem event.

See Also