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
close icon

DoubleTextBox NULL vs. Zero

Is it possible to differentiate between NULL and zero in a DoubleTextBox that is bound to a data source?
It seems I can display either the NullString property value or the number but I'd like to display my NullString property value when the underlying data value is NULL and I'd like to display zero ("0") when the underlying data value is, in fact, zero.
Coming at a different angle: databases can differentiate between zero and NULL, can the DoubleTextBox?

14 Replies

RC Rajesh C Syncfusion Team May 9, 2007 04:13 AM UTC

Hi Mark,

Thank you for using Syncfusion products.

It is possible to differentiate between NULL and zero in a DoubleTextBox by using UseNullString and NullString properties, Please refer to the following code snippet.
[ C# ]

this.doubleTextBox1.UseNullString = true;
this.doubleTextBox1.NullString = " ";

The Null and Zero will be displayed as shown in below.

Null equal to " "
Zero equal to "0.00"

Please let me know if you have any queries.

Regards,
Rajesh C


MA Mark Atkinson May 9, 2007 02:26 PM UTC

That's what I have (pretty much).

NullString = string.Empty;
UseNullString = true;

Does it make a difference if the NullString is blank vs. a space?

>Hi Mark,

Thank you for using Syncfusion products.

It is possible to differentiate between NULL and zero in a DoubleTextBox by using UseNullString and NullString properties, Please refer to the following code snippet.
[ C# ]

this.doubleTextBox1.UseNullString = true;
this.doubleTextBox1.NullString = " ";

The Null and Zero will be displayed as shown in below.

Null equal to " "
Zero equal to "0.00"

Please let me know if you have any queries.

Regards,
Rajesh C


MA Mark Atkinson May 9, 2007 06:13 PM UTC

I'm able to reproduce my issue in your samples.
If I change the DoubleEditBox demo to use:
UseNullString = true
NullString = " "

then, when I type a 0 into the text box, the control won't take it and just show a space. I'm trying to enter the value 0 but the control keeps showing the null string.



RC Rajesh C Syncfusion Team May 9, 2007 09:02 PM UTC

Hi Mark,

Thanks for the update. String.Empty and space are different. But you can use any either of them to differentiate the NULL and zero.

Please let me know if you have any other queries.

Regards,
Rajesh C


MA Mark Atkinson May 9, 2007 10:48 PM UTC

I can reproduce the issue consistently in your Sample Browser. I'm using the 4.4 libraries.

Repro steps:
1) Open the DoubleTextBox sample
2) Set the NullString property to " "
3) Set the UseNullString property to True
4) In the control type '0' (quotes mine)

Actual behaviour: Typing in '0' doesn't display 0 in the control, the control contains an empty space (the NullString value)
Possible Expected behaviour: The control should display what was typed in. the '0' character


>Hi Mark,

Thanks for the update. String.Empty and space are different. But you can use any either of them to differentiate the NULL and zero.

Please let me know if you have any other queries.

Regards,
Rajesh C


PJ Poly J Syncfusion Team May 10, 2007 12:00 PM UTC

Hi Mark,

I am able to see this issue in 4.4 version. We have fixed this issue in our latest version. The latest version of Essential Studio - v5.1.0.51 is available for download from the below location.

http://www.syncfusion.com/downloads/latestversion/default.aspx


Regards,
Poly



MA Mark Atkinson June 29, 2007 04:26 PM UTC

This is still not working in 5.1. I can still repro it in the TextBox Demo
To summarize, I'd like to be able to show NULL values (as blank, or space or whatever) and be able to type in the value 0. However, when the UseNullString is set to true, it's impossible for a user to type in 0. The control will just display the NULL string.
I don't want the NullString to be "0" because that gives the impression that the data bound to the control might actually contain "0" when, in fact, it is NULL.


>Hi Mark,

I am able to see this issue in 4.4 version. We have fixed this issue in our latest version. The latest version of Essential Studio - v5.1.0.51 is available for download from the below location.

http://www.syncfusion.com/downloads/latestversion/default.aspx


Regards,
Poly



GR Golda Rebecal Syncfusion Team July 2, 2007 02:34 PM UTC

Hi Mark,

I am afraid that I am not able to reproduce the issue of zero not being displayed in DoubleTextBox if the UseNullStringString = true & NullString = "" in v5.1.

Could you please modify the attached sample so that the issue could be reproduced? This will help us to resolve the issue soon.

http://websamples.syncfusion.com/samples/tools.Windows/F60587/main.htm

Best regards,
Golda


MA Mark Atkinson July 6, 2007 05:20 PM UTC

I'm unable to repro the bug in your sample here but I was able to repro it in the TextBoxDemo in the provided samples.
I'll have a closer look on my end.

thanks,
Mark

>Hi Mark,

I am afraid that I am not able to reproduce the issue of zero not being displayed in DoubleTextBox if the UseNullStringString = true & NullString = "" in v5.1.

Could you please modify the attached sample so that the issue could be reproduced? This will help us to resolve the issue soon.

http://websamples.syncfusion.com/samples/tools.Windows/F60587/main.htm

Best regards,
Golda


JA JayaLakshmi Syncfusion Team July 11, 2007 04:51 AM UTC

Hi Mark,

I am afraid that I am not able to reproduce the issue you specified in TextBoxDemoSample.

I have tried the following settings in both designer and code editor of TextBoxDemoSample.

UseNullStringString = true and NullString = ""

Could you please try to reproduce in the below sample ?

http://websamples.syncfusion.com/samples/Tools.Windows/F60587_new/main.htm

Kindly let me know whether you have added any additional code snippet other than the above settings that would help us to approach this issue much better.

Thanks for your patience.

Regards,
Jaya


MA Mark Atkinson September 19, 2007 04:32 PM UTC

OK, we've updated to 5.2 libraries and we're still having this problem. I'm able to repro the bug in your sample below as well.
to repro, go into the code and change the properties of intTotalBillTextBox like this:

this.intTotalBillTextBox.NullString = "";
this.intTotalBillTextBox.UseNullString = true;

Run the project and try to type in 0 for that control. I would expect to be able to set the value to 0 but when I type it in, nopthng gets displayed.

>Hi Mark,

I am afraid that I am not able to reproduce the issue you specified in TextBoxDemoSample.

I have tried the following settings in both designer and code editor of TextBoxDemoSample.

UseNullStringString = true and NullString = ""

Could you please try to reproduce in the below sample ?

http://websamples.syncfusion.com/samples/Tools.Windows/F60587_new/main.htm

Kindly let me know whether you have added any additional code snippet other than the above settings that would help us to approach this issue much better.

Thanks for your patience.

Regards,
Jaya


AD Administrator Syncfusion Team September 24, 2007 08:37 AM UTC

Hi Mark,

Thank you for bringing this issue to our notice.

Could you please open a DirectTrac incident with subject line "Zero is not displayed when UseNullString and NullString were set- F68374'. We will send you the bug fix details through our DirectTrac system.

Regards,
Jaya


VS Vladislav Sergeev August 7, 2008 03:31 PM UTC

Hello there!

I have the same issue (using 6.2.0.40). Has there been any progress on DoubleTextBox null vs. string.Empty?

Thanks




AD Administrator Syncfusion Team August 12, 2008 12:12 PM UTC

Hi Vladislav,

Sorry for the delay.

The issue with doubleTextBox "Not possible to differentiate between NULL and zero in a DoubleTextBox that is bound to a data source" which reported in this mail thread is fixed in our latest version 6.3.0.30 .

Please refer the sample:
http://websamples.syncfusion.com/samples/Tools.Windows/F60587_1/main.htm


Please let me know if any concerns.

Regards,
Hema





Loader.
Live Chat Icon For mobile
Up arrow icon