What's wrong with MaskedTextBox?

Posted by Admin on 07-Apr-2011 09:07

Hy,

Another problem with MaskedTextbox control...

THIS-OBJECT:maskedTextBox1:CausesValidation = FALSE.
THIS-OBJECT:maskedTextBox1:DataBindings:Add(NEW System.Windows.Forms.Binding("Text", THIS-OBJECT:bsCustomer, "birthday", TRUE)).
THIS-OBJECT:maskedTextBox1:Mask = "99/99/9999".

I really can't erase data value (birthday)!!!!!!

I try this :

THIS-OBJECT:maskedTextBox1:DataBindings["Text"]:NullValue = "".
THIS-OBJECT:maskedTextBox1:DataBindings["Text"]:WriteValue().

But it still fails...

CausesValidation is FALSE because if user doesn't fill control, the focus isn't release...

I found no solutions, I count on you

All Replies

Posted by jquerijero on 14-Apr-2011 15:38

You will need to clear the underlying database field then call the binding refresh method.

Posted by Admin on 18-Apr-2011 08:08

Hi Joseph,

clear the underlying database field

How can I do this and how this will help me?

When value of maskedtextbox control is empty, I would like it erase value into database.

Posted by jquerijero on 30-May-2012 10:48

The bindingsource will automatically put a temp-table record in scope. Clear the temp-table field that is bound to the TextBox then call Refresh of the BindingSource.

This thread is closed