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

DxRadioGroup<TData, TValue>.ValueExpression Property

Specifies a lambda expression that identifies the Value property’s bound value when the Radio Group is placed in the EditForm.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public Expression<Func<TValue>> ValueExpression { get; set; }

#Property Value

Type Description
Expression<Func<TValue>>

A lambda expression that identifies the bound value.

#Remarks

You can add the Radio Group component to Blazor’s standard EditForm component to validate the Value property value. In this case, the ValueExpression property is used to obtain metadata about the value bound to the Value property.

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

Razor
<DxRadioGroup Items="@Strings"
              Value="@Value"
              ValueExpression="@(() => Value )"
              ValueChanged="@ValueChanged">
</DxRadioGroup>

@code {
    string Value = null;
    // ...
    void ValueChanged(string MyString) {
        // ...
    }
}

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

Razor
<DxRadioGroup Items="@Languages"
              @bind-Value="@PreferredLanguage"/>
<p>Preferred language:
    <strong>@PreferredLanguage</strong>
</p>

@code {
    string PreferredLanguage { get; set; } = "English";
    IEnumerable<string> Languages = new[] { "English", "简体中文", "Español", "Français", "Deutsch" };
}
See Also