HighTechTalks DotNet Forums  

TextBox bound to a numeric value does not allow nulls

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss TextBox bound to a numeric value does not allow nulls in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Emil
 
Posts: n/a

Default TextBox bound to a numeric value does not allow nulls - 12-18-2007 , 02:48 PM






Hi,
I have a textbox bounded thru a bindingsource to a dataset.
In the dataset the bounded column allows nulls, but if i try to delete the
value from the textbox and move the focus, the focus does not move. The
textbox does not allow null.
(The column in the table in the database allows nulls).
How can I enable the textbox to accept a blank value as null?



Reply With Quote
  #2  
Old   
Cor Ligthert[MVP]
 
Posts: n/a

Default Re: TextBox bound to a numeric value does not allow nulls - 12-18-2007 , 11:32 PM






Emil,

This is strange, I never have noticed that, however you can use the binding
events to do what you ask. But in your case I would first search if the
problem is not somewhere else. If you use the events for that then your
program becomes much less maintainable.

Here a link how to use the binding events, it is with a datetime because
that is one of the situations it can be needed.
I have never used it with a textbox.

http://www.vb-tips.com/DataBindingEvents.aspx


Cor

"Emil" <EMiclaus (AT) binsky (DOT) com> schreef in bericht
news:%23$4yl7aQIHA.536 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Quote:
Hi,
I have a textbox bounded thru a bindingsource to a dataset.
In the dataset the bounded column allows nulls, but if i try to delete the
value from the textbox and move the focus, the focus does not move. The
textbox does not allow null.
(The column in the table in the database allows nulls).
How can I enable the textbox to accept a blank value as null?




Reply With Quote
  #3  
Old   
Emil
 
Posts: n/a

Default Re: TextBox bound to a numeric value does not allow nulls - 12-19-2007 , 10:37 AM



This is strange,

if in the Formatting and Advanced Binding dialog I set a different value for
"Null Value", for example "<null>", when the program runs if I type <null>
in the textbox it takes it and I can move the focus,
but if I leave the default blank value for "Null Value" is not working.

Emil

"Emil" <EMiclaus (AT) binsky (DOT) com> wrote

Quote:
Hi,
I have a textbox bounded thru a bindingsource to a dataset.
In the dataset the bounded column allows nulls, but if i try to delete the
value from the textbox and move the focus, the focus does not move. The
textbox does not allow null.
(The column in the table in the database allows nulls).
How can I enable the textbox to accept a blank value as null?





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.