windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemcombobox-bfb37258.md
Gets or sets whether the height of items is automatically calculated to fit their entire content.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(false)]
[DXCategory("Behavior")]
public virtual bool ItemAutoHeight { get; set; }
<DXCategory("Behavior")>
<DefaultValue(False)>
Public Overridable Property ItemAutoHeight As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true if item height is automatically calculated; otherwise, false.
|
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");
comboBoxEdit1.Properties.ItemAutoHeight = True
comboBoxEdit1.Properties.Items.Add("1st item")
comboBoxEdit1.Properties.Items.Add("2nd item\r\n2nd item")
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