Skip to main content

DxTagBox<TData, TValue>.ValuesExpression Property

Specifies a lambda expression that identifies the Values property’s bound values when the Tag Box is placed in the EditForm.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor


public Expression<Func<IEnumerable<TValue>>> ValuesExpression { get; set; }

Property Value

Type Description

A lambda expression that identifies bound values.


You can add the Tag Box editor to Blazor’s standard EditForm component to validate the Values property value. In this case, the ValuesExpression property is used to obtain metadata about values bound to the Values property.

You should specify the ValuesExpression property if you handle the ValuesChanged event and cannot use two-way binding.

<DxTagBox Data="@Strings" ...
          ValuesExpression="@(() => values )"

@code {
    IEnumerable<string> values = null;
    // ...
    void ValuesChanged(IEnumerable<string> MyStrings) {
        // ...

The ValuesExpression property is set internally if you use the @bind attribute for the Values property to implement two-way binding.

<DxTagBox Data="@Strings" ...

@code {
    IEnumerable<string> newValues = null;
    IEnumerable<string> Values { get => newValues; set { newValues = value; InvokeAsync(StateHasChanged); } }
    // ...

The following exception occurs if you do not use two-way binding or the ValuesExpression property:

DevExpress.Blazor.DxTagBox requires a value for the ‘ValuesExpression’ property. It is specified automatically when you use two-way binding (‘bind-Value’).

See Also