Articles in this section
Category / Section

How to Customize the .NET MAUI Radio Buttons with Rounded Rectangle and Group Selection?

2 mins read

The .NET MAUI RadioButton allows you to group a set of radio buttons using the .NET MAUI RadioGroup and .NET MAUI RadioGroupKey.
To create a rounded rectangle Radio Button, we need to place the Radio Button within a Border. However, we cannot maintain the group selection of rounded rectangle radio buttons using Radio Group, as it disrupts the internal layout and event handling mechanisms of the SfRadioGroup. The SfRadioGroup expects direct child SfRadioButton elements to properly manage selection. Therefore, we use the Radio Group Key to maintain the group selection of rounded rectangle radio buttons.

XAML:

<ContentPage.Resources>
    <Style x:Key="SettingsRoundRect" TargetType="Border">
        <Setter Property="WidthRequest" Value="300"/>
        <Setter Property="StrokeShape" Value="RoundRectangle 10"/>
    </Style>
</ContentPage.Resources>

<StackLayout>
  <buttons:SfRadioGroupKey x:Name="RadioGroupKey" Spacing="5" >
        <Border  Style="{StaticResource SettingsRoundRect}">
            <buttons:SfRadioButton Text="Style 1"  Value="1" GroupKey="{Binding Source={x:Reference RadioGroupKey}}"/>
        </Border>
      
        <Border Style="{StaticResource SettingsRoundRect}" >
            <buttons:SfRadioButton Text="Style 2" Value="2" GroupKey="{Binding Source={x:Reference RadioGroupKey}}"/>
        </Border>

        <Border Style="{StaticResource SettingsRoundRect}" >
            <buttons:SfRadioButton Text="Style 3" Value="3" GroupKey="{Binding Source={x:Reference RadioGroupKey}}"/>
        </Border>
    </buttons:SfRadioGroupKey>
</StackLayout>

Output:

Screen-Recording-2025-03-10-1529.gif

Download the complete sample from the GitHub.

Conclusion

I hope you enjoyed learning how to customize the .NET MAUI radio buttons with rounded rectangles and group selection.
You can refer to our .NET MAUI RadioButton feature tour page to know about its other groundbreaking feature representations and .NET MAUI RadioButton documentation, and how to quickly get started for configuration specifications.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied