Back to Devexpress

RepositoryItem.AutoHeight Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-e79dceea.md

latest5.3 KB
Original Source

RepositoryItem.AutoHeight Property

Gets or sets a value specifying whether the editor’s height is calculated automatically to fit the editor’s content.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Behavior")]
public virtual bool AutoHeight { get; set; }
vb
<DXCategory("Behavior")>
Public Overridable Property AutoHeight As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the editor’s height is calculated automatically to fit the editor’s content; otherwise, false.

|

Remarks

If the AutoHeight property value is true , editors automatically change their height to the minimum required to fit their content according to the style currently applied. Note: in this case, changing the editor’s Height property value will have no effect. If you need to specify the editor’s height manually, set the AutoHeight property to false.

Automatic height calculation is not supported by all editors. Thus, the AutoHeight property is overridden by some RepositoryItem descendants to hide it at design time and return false always.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AutoHeight property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-spreadsheet-assign-custom-in-place-editors/CS/Spreadsheet_CustomCellEditors/Form1.cs#L61

csharp
RepositoryItemSpinEdit repository = new RepositoryItemSpinEdit();
repository.AutoHeight = false;
repository.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;

winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L100

csharp
RepositoryItemSpinEdit editor = new RepositoryItemSpinEdit();
editor.AutoHeight = false;
editor.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;

winforms-grid-display-editors-in-columns-headers/CS/WindowsApplication1/InplaceEditorHelper/ColumnInplaceEditorHelper.cs#L125

csharp
ActiveEditor.Properties.Assign(_Item);
ActiveEditor.Properties.AutoHeight = false;
ActiveEditor.Location = bounds.Location;

winforms-spreadsheet-assign-custom-in-place-editors/VB/Spreadsheet_CustomCellEditors/Form1.vb#L52

vb
Dim repository As RepositoryItemSpinEdit = New RepositoryItemSpinEdit()
repository.AutoHeight = False
repository.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder

winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L91

vb
Dim editor As RepositoryItemSpinEdit = New RepositoryItemSpinEdit()
editor.AutoHeight = False
editor.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder

winforms-grid-display-editors-in-columns-headers/VB/InplaceEditorHelper/ColumnInplaceEditorHelper.vb#L118

vb
ActiveEditor.Properties.Assign(_Item)
ActiveEditor.Properties.AutoHeight = False
ActiveEditor.Location = bounds.Location

See Also

AutoWidth

RepositoryItem Class

RepositoryItem Members

DevExpress.XtraEditors.Repository Namespace