ReturnType property?

Shouldn't SfMaskedEntry have a ReturnType property?


1 Reply

BV Brundha Velusamy Syncfusion Team February 15, 2024 01:27 PM UTC

Hi Arthur,


Query : Shouldn't SfMaskedEntry have a ReturnType property?


Currently, SfMaskedEntry does not directly support the ReturnType property. However, you can achieve similar functionality by utilizing the entry ReturnType which is a children of SfMaskedEntry, in your project. Below is a code snippet demonstrating how you can implement this behavior in SfMaskedEntry. We have also provided a sample for your reference. Please review it and let us know the details.


Please refer the below code snippet for this,

    private void maskedEntry_HandlerChanged(object sender, EventArgs e)

    {

#if ANDROID

        if (sender is SfMaskedEntry maskedEntry)

        {

            if ((maskedEntry.Children[0] as Entry)?.Handler != null && (maskedEntry.Children[0] as Entry)?.Handler?.PlatformView is AndroidX.AppCompat.Widget.AppCompatEditText androidEntry)

            {

                androidEntry.ImeOptions = Android.Views.InputMethods.ImeAction.Search;

                androidEntry.SetImeActionLabel("Send", Android.Views.InputMethods.ImeAction.Search);

            }

        }

#elif IOS

        if ((maskedEntry.Children[0] as Entry)?.Handler != null && (maskedEntry.Children[0] as Entry)?.Handler?.PlatformView is UIKit.UITextField iOSEntry)

        {

            iOSEntry.ReturnKeyType = UIKit.UIReturnKeyType.Next;

        }

#endif

}


Regards,

Brundha V


Attachment: SfMaskedEntrySample_d8c9780c.zip

Loader.
Up arrow icon