Getting Started of Xamarin.Android NumericUpDown(SfNumericUpDown)

14 Oct 20223 minutes to read

This section provides overview for working with Essential NumericUpDown for Xamarin.Android. You can walk through the entire process of creating a SfNumericUpDown.

Referencing Essential Studio Components in Your Solution

After installing Essential Studio for Xamarin, you can find all the required assemblies in the installation folders,

{Syncfusion Installed location}\Essential Studio\\lib

Add the following assembly references to the Android project,


Add SfNumericUpDown

The SfNumericUpDown control configured entirely in C# code or using the AXML markup. The following steps explain how to create a SfNumericUpDown and configure their elements.

Add the following code in the Main.axml to include NumericUpDown control.

  • XAML
  • <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android=""
    	android:layout_width="fill_parent" />

    In MainActivity, you can access the NumericUpDown instance defined in axml page using the following code.

  • C#
  • using Com.Syncfusion.NumericUpDown;
    public class MainActivity : Activity
        protected override void OnCreate(Bundle savedInstanceState)
            SfNumericUpDown numericUpDown = (SfNumericUpDown)FindViewById(Resource.Id.sfNumericUpDown);
            numericUpDown.Value = 30;

    Also, you can create the NumericUpDown control using the code behind. The following steps help to add NumericUpDown control using the code behind.

    • Adding reference to NumericUpDown.

      using Com.Syncfusion.NumericUpDown;
    • Create an instance of SfNumericUpDown.

      SfNumericUpDown numeric = new SfNumericUpDown(this);

    Set Value

    The SfNumericUpDown control display value can be set using Value property.

    numeric.Value= 5;

    Enable Parsing Mode

    The value of the SfNumericUpDown can be parsed based on the ParsingMode property.


    The ParsingMode is of type Parsers containing enum values of Double and Decimal.


    Add Format String

    The FormatString property determines the format specifier by which the display text has to be formatted.

    It has three types,

    • c - Display the value with currency notation.
    • n – Display the value in number format.
    • p – Display the value in Percentage.


    The control displays the formatted text on lost focus. Default Value of FormatString is “n”.

    numeric.FormatString= c;

    Xamarin.Android NumericUpDown getting started Image