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. Image for the cookie policy date
close icon

DateTimeEdit Empty Date

Hi, I'm setting a DateTimeEdit with IsEmptyDateEnabled=True, I see the "none" button in the Calendar and it sets the DateTime to null. But I would also like to be able to hit the "delete" or "backspace" keys while the control's text is selected to nullify the its value. I noticed there's a property called "EnableBackspaceKey" and another one called "EnableDeleteKey" but setting any or both to "True" has no effect on the behavior of the control. Does anybody knows if its possible to nullify the control's DateTime value by using the keyboard?

Thanks.

 

 

 

 


3 Replies

JR Jegan Raj M Syncfusion Team July 11, 2013 10:05 AM UTC

Hi Michel,

Thanks for your interest in Syncfusion Products.

We have created workaround sample based on your request which can be downloaded from the below link.
In this below sample, in 'PreviewKeyUp' event we are checking for the pressed key, nullify the date if 
the key is either 'Backspace' or 'Delete'

Please let us know if you have any queries.

Regards,
Jegan Raj M


DateTimeEditIssue_ba07648f.zip


MC Michel Cossette July 11, 2013 09:39 PM UTC

Hi Jegan Raj,

Thanks for the workaround, I had tried the PreviewKeyDown event but its not raised for some reason and I didn't think of trying the PreviewKeyDown event instead. Anyways,  I refactored your code into an Attached Behaviour which is set in the implicit style that targets DateTimeEdit, it is set to Enabled when the property IsEmptyDateEnabled is itself set to true via a style trigger. It works great. Nonetheless I think this behaviour should be wired in the control itself, in a future release perhaps!

Here's my code:

 

    



JR Jegan Raj M Syncfusion Team July 18, 2013 09:06 AM UTC

Hi Michel,

Thanks for your update.

We have forwarded your suggestion to our development team.
By analyzing the property used and the code changes done we will make necessary changes in our further 
release.

Please let us know if you have any queries.

Regards,
Jegan Raj M

Loader.
Live Chat Icon For mobile
Up arrow icon