We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to display a blank in the editors when the databound value is null?

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.

UseNullOption

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.

XAML

C#

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

XAML

C#

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:
4420 04/14/2015 04/14/2015 WPF IntegerTextBox 4.5 12.4.0.24
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.