Skip to main content

DxTagBox<TData, TValue>.DropDownWidthMode Property

Specifies the width of the drop-down list.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.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.

    TagBox Content or Editor Width

  • ContentWidth - The list width is equal to the width of the longest list item.

    TagBox Content Width

  • EditorWidth - The list width matches the editor. List items are cut if they do not fit.

    TagBox Editor Width

Note

When the TagBox 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

<DxTagBox Data="@Staff.DataSource"
          @bind-Values="@SelectedStaff"
          TextFieldName="@nameof(Person.Text)"
          DropDownWidthMode="DropDownWidthMode.EditorWidth">
</DxTagBox>

@code {
    IEnumerable<Person> SelectedStaff { get; set; }
}

Run Demo: TagBox – Drop-Down List Width

See Also