Skip to content

RadioButtonGroup not working with CollectionView #33264

@michele-guion

Description

@michele-guion

Description

I have a StackLayout which contains a CollectionView made of radio buttons.
RadioButtonGroup.SelectedValue is correctly bound in .NET9, but not in .NET10.

Steps to Reproduce

<StackLayout RadioButtonGroup.GroupName="{Binding GroupName}" RadioButtonGroup.SelectedValue="{Binding SelectedValue}" >
    <CollectionView
        SelectionMode="None"
        ItemsSource="{Binding Items}">
        <CollectionView.ItemTemplate>
            <DataTemplate x:DataType="x:String">
                <RadioButton 
                    Value="{Binding .}"
                    Content="{Binding .}"
                    GroupName="{Binding GroupName, Source={RelativeSource Mode=FindAncestorBindingContext, AncestorType={x:Type models:MainPageModel}}, x:DataType=models:MainPageModel}" />
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>

    <Label Text="Group name:" />
    <Label Text="{Binding GroupName}" />

    <Label Text="Selected value:" />
    <Label Text="{Binding SelectedValue}" />
</StackLayout>

In .NET9, if you change the selection, the label will be updated accordingly. In .NET10 this does not happen.

Link to public reproduction project repository

No response

Version with bug

10.0.20

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.120 SR12

Affected platforms

I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

I manually managed CheckedChanged event on the radio buttons and update the model accordingly.

Relevant log output

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions