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.

NOTE

By default, the property value is false.

<syncfusion:SfNumericTextBox x:Name="numericTextBox" AllowNull="true" />
SfNumericTextBox numericTextBox = new SfNumericTextBox();
numericTextBox.AllowNull=true;
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;
this.Content=numericTextBox;

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