Assign Nullable Value in Xamarin Numeric Entry (SfNumericTextBox)

19 May 20211 minute to read

The null values can be set in SfNumericTextBox Value property, by setting AllowNull property value to true.


By default, the property value is false.

<syncfusion:SfNumericTextBox x:Name="numericTextBox" AllowNull="true" />
SfNumericTextBox numericTextBox = new SfNumericTextBox();
this.Content = numericTextBox;

Display nullable value image

Set Hint Text

The WaterMark property can be used to provide a hint that helps the user to get started with their input. The watermark text is visible when value is empty or null.

<syncfusion:SfNumericTextBox x:Name="numericTextBox" AllowNull = "true"  Watermark="Getting Started" />
SfNumericTextBox  numericTextBox=new SfNumericTextBox();
numericTextBox.Watermark = "Getting Started";
numericTextBox.AllowNull = true;

Display watermark text image

For customizing the color of NumericTextBox’s Watermark refer

See also

How to have null values in SfNumericTextBox

How to provide null value to SfNumericTextBox