Custom SfRadioButton using a Handler

I want to use padding to leave a space between the radio button and the text using the sfRadioButton control.

I currently have this code that does exactly that, but with MAUI's default RadioButton control.

code .cs

public class CustomRadioButton : RadioButton
{
}


    public App()
    {
        RadioButtonHandler.Mapper.AppendToMapping("MyCustomRadioButton", (handler, button) =>
        {
            if (button is not CustomRadioButton) return;

var control = handler.PlatformView;
#if ANDROID
            control.SetPadding(40, 0, 0, 0);
#elif IOS || MACCATALYST
            Console.WriteLine("CustomRadioButton not implement for iOS");
#elif WINDOWS
            Console.WriteLine("CustomRadioButton not implement for Windows");
#endif
        });
    }

usage in xaml

<renderers:CustomRadioButton Content="Theme" />

radiobutton.PNG

 What I want is to achieve the same effect but with the sfRadioButton control. How could I achieve this?

And if they add that property to the control it would be excellent


1 Reply

BV Brundha Velusamy Syncfusion Team March 14, 2024 09:11 AM UTC

Hi Eyner,

 

Currently, we do not have support to adjust the padding between the radio button and the associated text in SfRadioButton. We have created a new feature request for this "Provide TextPadding support for the .NET MAUI SfRadioButton". Please find the link below to track the status of the feature implementation.

 

Feedback Link: Feedback-51765

 

Please cast your vote to make it count. We will prioritize the features every release based on the demands and we do not have an immediate plan to implement this feature since we have committed to already planned work. So, this feature will be available in any of our upcoming releases.

 

If you have any more specifications/suggestions for the feature request, you can add them as a comment in the portal. We will share the release details in the feedback itself.

 

Regards,

Brundha V


Loader.
Up arrow icon