Skip to main content

RepositoryItemLookUpEdit.PopupWidth Property

Gets or sets the width of the dropdown window (in pixels).

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue(0)]
[DXCategory("Behavior")]
public virtual int PopupWidth { get; set; }

Property Value

Type Default Description
Int32 0

The width of the dropdown window.

Remarks

Use the PopupWidth property to specify the initial width of the dropdown window, i.e., the width when the dropdown is opened for the first time. When the window is open, the editor stores its current width to be used if the window is subsequently re-opened. So, changing the PopupWidth after the window has been opened has no effect.

The PopupWidth determines the total width of the dropdown window, including borders, the vertical scroll bar (if any) and the shadow. A vertical scroll bar appears if the number of rows in the RepositoryItemLookUpEditBase.DataSource is greater than the RepositoryItemLookUpEdit.DropDownRows value. The shadow visibility is controlled by the RepositoryItemPopupBase.ShowPopupShadow property.

The column’s LookUpColumnInfo.Width property determines the width of the column relative to the other columns. This specifies the fraction of the popup width occupied by the column. For instance, if you have two columns whose widths are set to 10 and 20 and the client popup width is 300, then the actual column widths will be 100 (10*300/(10+20)) and 200 (20*300/(10+20)).

You can also enable best-fit mode to automatically resize columns and the popup window. This can be accomplished by setting the RepositoryItemLookUpEditBase.BestFitMode property to BestFitMode.BestFitResizePopup. When this mode is turned on, the PopupWidth value is ignored.

Setting the PopupWidth property to a value less than the edit box width has no effect.

It is also not possible to set the popup width to a value less than the dropdown’s minimum width, which is specified by the RepositoryItemPopupBase.PopupFormMinSize property. By default, the RepositoryItemPopupBase.PopupFormMinSize value is (0, 0), which is equivalent to (200, 100).

See Also