Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Before the form is displayed, all radio buttons belong to the same radio group

I have two groups of radio buttons, I need the first radio button in each group to be checked as default, but for some reason, after starting, only the last one that I checked is checked, and it does not matter if I do it from code or in the layout, after showing the form, the groups work correctly, but are not initialized correctly, here is an example and the result:

<StackLayout>
        <StackLayout>
            <RadioButton GroupName="1" Content="1.1" IsChecked="True"/>
            <RadioButton GroupName="1" Content="1.2"/>
        </StackLayout>
        
        <StackLayout>
            <RadioButton GroupName="2" Content="2.1" IsChecked="True"/>
            <RadioButton GroupName="2" Content="2.2"/>
        </StackLayout>
    </StackLayout>

the result:

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

while expected result should be:

enter image description here

I tried changing the layout, grouping the radio buttons in different ways, but that didn’t help.

>Solution :

I created a new project with your code and I can reproduce your problem in my project. But this problem only appeared on the windows platform. I can get the expected result when I tested it on the android.

In addition, I found it is a known issue on the github. You can follow up this issue about RadioButton GroupName and IsChecked properties work inconsistently on Windows.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading