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

IntegerTextBox always defaults to "0". Want Null.

Thread ID:





140849 Nov 11,2018 09:06 AM UTC Nov 12,2018 06:06 AM UTC WPF 1
Tags: IntegerTextBox
Vasudeva Naik
Asked On November 11, 2018 09:06 AM UTC

I am having trouble setting the default value of IntegerTextBox to null.
Her is the code I am using:
<syncfusion:IntegerTextBox BorderThickness="0.5,0,0,0.5" ParameterValue="buy" BorderBrush="{StaticResource SeparatorBrush}" 
                                                        Value="{Binding Quantity}" UseNullOption="True" Height="18.46" NullValue="{x:Null}" MinValue="0"/>

I am using this text box in the itemsTemplate of an itemsControl. It is showing 0 always.

Arulraj A [Syncfusion]
Replied On November 12, 2018 06:06 AM UTC

Hi Vasudeva

Thank you for contacting Syncfusion Support.

We have checked the reported query and understood that you want to set the null in the Integer Textbox. On observing your code, we could understood that you have not bound the value as nullable type. To achieve your requirement, you need to bound the value using int? nullable value type. The same has been explained in our sample and please download it from the following link:

Sample: http://www.syncfusion.com/downloads/support/forum/140849/ze/IntegerTextboxApplication153114976

Please refer the following KB for the more information
KB: https://www.syncfusion.com/kb/4420/how-to-display-a-blank-in-the-editors-when-the-databound-value-is-null

Please try this solution and let us know if it is helpful.

Arulraj A


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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
Live Chat Icon