To display a null value instead of the constant zero when the databound value of the editor is null, set the UseNullOption property as True.
The UseNullOption is a boolean property of the Editors like CurrencyTextBox, IntegerTextBox, DoubleTextBox, PercentTextBox that is used to display a null when the databound value is null according to its Values such as True and False.
When the value of UseNullOption is True, it displays a Null Value when the databound Value of the editors is null.
When the value of UseNullOption is False, it disables the Null value and display the constant zero for the control.
Here is an example that describes the use of UseNullOption property in the IntegerTextBox.
The following code example demonstrates the same.
The following screenshot displays the Null value when the UseNullOption property is set to True for an IntegerTextBox
Figure 1: Null value of the IntegerTextBox
The following screenshot displays the default value of the IntegerTextBox as Zero when the UseNullOption property is set to False for an IntegerTextBox.
Figure 2: Default value of the IntegerTextBox as Zero
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:||Product Version:|