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.
Unfortunately, activation email could not send to your email. Please try again.

MaskedEditBox - Date formated - support of DBNull?

Thread ID:





42900 Apr 10,2006 04:50 AM Apr 12,2006 05:59 AM Windows Forms 1
Tags: Tools
Gerlinde Rohen
Asked On April 10, 2006 04:50 AM

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

Vijayanand S [Syncfusion]
Replied On April 12, 2006 05:59 AM

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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.