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

IntegerTextBox always defaults to "0". Want Null.

Hi,
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.

1 Reply

AA Arulraj A Syncfusion Team November 12, 2018 01:06 AM

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.

Regards,
Arulraj A
 


Loader.
Live Chat Icon For mobile
Up arrow icon