Back to Devexpress

RepositoryItemLookUpEditBase.BestFitMode Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemlookupeditbase-8573f001.md

latest4.7 KB
Original Source

RepositoryItemLookUpEditBase.BestFitMode Property

Gets or sets the “best-fit” mode for columns in the dropdown window.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(BestFitMode.None)]
[DXCategory("Behavior")]
public BestFitMode BestFitMode { get; set; }
vb
<DXCategory("Behavior")>
<DefaultValue(BestFitMode.None)>
Public Property BestFitMode As BestFitMode

Property Value

TypeDefaultDescription
BestFitModeNone

A BestFitMode value that specifies the “best-fit” mode for columns in the dropdown window.

|

Available values:

NameDescription
None

The “best-fit” functionality is not invoked.

| | BestFit |

The “best-fit” functionality is invoked when opening the dropdown window for the first time, changing the proportional widths of the columns to best fit their contents.

| | BestFitResizePopup |

The “best-fit” functionality is invoked when opening the dropdown window for the first time, changing the proportional widths of the columns according to their contents and resizing the dropdown window to fit all the columns.

The dropdown window cannot be reduced to a size less than the minimum size specified by the editor’s RepositoryItemPopupBase.PopupFormMinSize property.

|

Remarks

The “best-fit’ feature proportionally resizes the columns in the dropdown according to their contents. For a description of the available best-fit modes, see BestFitMode.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BestFitMode 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-lookupedit-bind-to-simple-data-types/CS/LookupEdit-StandardBinding/Form1.cs#L32

csharp
// Enable the "best-fit" functionality mode in which columns have proportional widths and the popup window is resized to fit all the columns.
riLookup.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
// Specify the dropdown height.

winforms-lookupedit-bind-to-simple-data-types/VB/LookupEdit-StandardBinding/Form1.vb#L34

vb
' Enable the "best-fit" functionality mode in which columns have proportional widths and the popup window is resized to fit all the columns.
riLookup.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup
' Specify the dropdown height.

See Also

BestFit()

BestFitRowCount

PopupWidth

PopupWidthMode

BestFitMaxRowCount

RepositoryItemLookUpEditBase Class

RepositoryItemLookUpEditBase Members

DevExpress.XtraEditors.Repository Namespace