Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTagBox<TData, TValue>.TagsExpression Property

Specifies a lambda expression that identifies the Tags property’s bound value when the TagBox is placed in the EditForm.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public Expression<Func<IEnumerable<string>>> TagsExpression { get; set; }

#Property Value

Type Description
Expression<Func<IEnumerable<String>>>

A lambda expression that identifies the bound value.

#Remarks

You can add the TagBox to Blazor’s standard EditForm component to validate the Tags property value. In this case, the TagsExpression property is used to obtain metadata about the value bound to the Tags property.

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

Razor
<DxTagBox Data="@Strings" 
          TData="string"
          TValue="string"
          Tags="@Tags"
          TagsExpression="@(() => Tags)"
          TagsChanged="@TagsChanged"
          ValidateBy="TagBoxValidateBy.Tags">
</DxTagBox>

@code {
    IEnumerable<string> Tags = null;
    // ...
    void TagsChanged(IEnumerable<string> tags) {
        // ...
    }
}

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

Razor
<DxTagBox Data="@Strings" ...
          @bind-Tags="@Tags">
</DxTagBox>

@code {
    IEnumerable<string> Tags { get; set; } = null; 
    // ...
}

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

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

See Also