Return Type in Xamarin Numeric Entry (SfNumericTextBox)

15 Sep 20232 minutes to read

You can define the return key type of SfNumericTextBox by using the ReturnType property of the type Xamarin.Forms ReturnType.

<syncfusion:SfNumericTextBox ReturnType= "Next" Value="123" />
SfNumericTextBox numericTextBox = new SfNumericTextBox();
numericTextBox.ReturnType = ReturnType.Next;
numericTextBox.Value = 123;

NOTE

Default value of ReturnType is Default.

Xamarin.Forms Numeric TextBox with return type

Return Command

The ReturnCommand property defines an ICommand implementation that wraps an action when the user presses return button.

Return Command Parameter

The ReturnCommandParameter property is used to set the parameter that is sent to the ReturnCommand.

<ContentPage.BindingContext>
    <local:ViewModel />
 </ContentPage.BindingContext>

	<syncfusion:SfNumericTextBox x:Name="NumericTextBox"
                             ReturnType="Next"
                             Value="123"
                             ReturnCommand="{Binding CommandProperty}"
                             ReturnCommandParameter="{x:Reference NumericTextBox}"/>
public class ViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged = delegate { };
        public ICommand CommandProperty { protected set; get; }
        public ViewModel()
        {
            CommandProperty = new Command(ReturnButtonClicked);
        }
        
        private void ReturnButtonClicked(object obj)
        {
            var numericTextBox = obj as SfNumericTextBox;
        }
    }

See also

How to get the localized return key on the iOS keyboard in SfNumericTextBox