DxDropDownListEditorBase<TData, TValue>.DropDownWidthMode Property
Specifies the width of the drop-down list.
Namespace: DevExpress.Blazor.Base
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(DropDownWidthMode.ContentOrEditorWidth)]
[Parameter]
public DropDownWidthMode DropDownWidthMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
DropDownWidthMode | ContentOrEditorWidth | A DropDownWidthMode enumeration value. |
Available values:
Name | Description |
---|---|
ContentOrEditorWidth | The list displays item text completely. The minimum list width matches the editor. |
ContentWidth | The list width is equal to the width of the longest list item. |
EditorWidth | The list width matches the editor. List items are cut if they do not fit. |
Remarks
Use the DropDownWidthMode
property to specify the width of the drop-down list. The following values are available:
ContentOrEditorWidth (Default) - The list displays item text completely. The minimum list width matches the editor.
ContentWidth - The list width is equal to the width of the longest list item.
EditorWidth - The list width matches the editor. If item text does not fit the editor width, item text is displayed across multiple lines.
Note
When the ComboBox renders items on demand (ListRenderMode is set to Virtual
), the list width can change while users scroll items.
The following code sets the width of the drop-down list to the editor width.
@using BlazorApp.Data
<DxComboBox Data="@Staff.DataSource"
@bind-Value="@Value"
TextFieldName="@nameof(Person.Text)"
DropDownWidthMode="DropDownWidthMode.EditorWidth">
</DxComboBox>
@code {
Person Value { get; set; } = Staff.DataSource[0];
}