Skip to main content

DxRadio<TValue>.GroupValueChanged Event

Fires when the selected radio button changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[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.

@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