TextBox bound to a numeric value does not allow nulls

E

Emil

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?
 
C

Cor Ligthert[MVP]

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
 
E

Emil

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top