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

DxRadio<TValue>.GroupValueChanged Event

Fires when the selected radio button changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public override EventCallback<TValue> GroupValueChanged { get; set; }

#Parameters

Type Description
TValue

The value type.

#Remarks

Handle the GroupValueChanged event to respond to the group value change.

Razor
@foreach(var option in new[] { "Option 1", "Option 2"@*, ...*@ }) {
    <DxRadio GroupName="options" Value="@option" GroupValue="@Value"
        GroupValueChanged="@((string value) => OnGroupValueChanged(value))">
        ...
    </DxRadio>
}
@if(Flag) {
    @foreach(var subOption in new[] { "SubOption 1", "SubOption 2"@*, ...*@ }) {
        <DxRadio GroupName="subOptions" Value="@subOption" GroupValue="@OtherValue"
            GroupValueChanged="@((string value) => OnOtherGroupValueChanged(value))">
            ...
        </DxRadio>
    }
}

@code {
    string Value { get; set; }
    string OtherValue { get; set; }
    bool Flag { get; set; }

    void OnGroupValueChanged(string newValue) {
        Value = newValue;
        if(newValue == "Option N")
            Flag = true;
    }
    void OnOtherGroupValueChanged(string newValue) {
        @*Your code*@
    }
}
See Also