MaskedEditBox - Date formated - support of DBNull?

Hallo, is there any possibility to enable a MaskedEditBox(date-formated) for DBNULL? And than is there also a chance to ''clear'' a date to DBNULL by pressing Backspace or Delete? It read, that in a DateTimePickerAdv DBNULL values can be enabled by setting EnableNullDate=true. Thanks Gerlinde Rohen

1 Reply

VS Vijayanand S Syncfusion Team April 12, 2006 09:59 AM UTC

Hi Gerlinde, I am afraid, there is no possiblity to enable the DBNULL value in our current implementation of MaskedEditBox. As a workaround, you can derive a custom MaskedEditBox and override the ProcessCmdKey method inorder to delete all the contents in the textbox when the user presses the Del key. Here is the code snippet of derived control: public class DateMaskedEditBox:Syncfusion.Windows.Forms.Tools.MaskedEditBox { protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if(keyData ==Keys.Delete && this.Text!=String.Empty) { this.Text=String.Empty; this.SetSelection(0,1); } return base.ProcessCmdKey (ref msg, keyData); } } Please take a look at the attached sample and let me know if you have any questions. Thanks for your interest in Syncfusion products. Regards, Vijay Project3.zip

Loader.
Up arrow icon