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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: WPF |
Control: DoubleTextBox |
.NET Framework: 4.5 |
Product Version: 12.4.0.24

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

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile