Skip to main content
All docs
V24.1

DxDropDownListEditorBase<TData, TValue>.TextFieldName Property

Specifies the data source field that contains text for editor’s items.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue("")]
[Parameter]
public string TextFieldName { get; set; }

Property Value

Type Default Description
String String.Empty

A string value that specifies a data source field’s name.

Remarks

Use the TextFieldName property when you bind an editor (ComboBox or TagBox) to a data source that store custom objects (IEnumerable<CustomType>). This property specifies the name of the data source field that stores text for the TagBox items.

If the TextFieldName property is not specified, the editor searches for a Text field in the data source and uses this field as a text field. Otherwise, the editor populates its items with the CustomType.ToString() values.

ComboBox Example

@using BlazorApp.Data

<DxComboBox Data="@Staff.DataSource"
            @bind-Value="@SelectedPerson"
            TextFieldName="TextField"
            DropDownWidthMode="DropDownWidthMode.EditorWidth"
            AllowUserInput="true">
</DxComboBox>

@code {
    Person SelectedPerson { get; set; } = Staff.DataSource[0];
}

ComboBox CustomObject

Run Demo: ComboBox - Overview

TagBox Example

@using BlazorApp.Data

<DxTagBox Data="@Staff.DataSource"
          @bind-Values="@SelectedStaff"
          TextFieldName="TextField"
          DropDownWidthMode="DropDownWidthMode.EditorWidth">
</DxTagBox>

@code {
    IEnumerable<Person> SelectedStaff { get; set;} = new List<Person>() { Staff.DataSource[0] };
}

Run Demo: TagBox – Drop-Down List Width

Implements

DevExpress.Blazor.IListEditorBase<TData, TValue>.TextFieldName
See Also