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.

DateTimeEdit Empty Date

Thread ID:

Created:

Updated:

Platform:

Replies:

109918 Jul 10,2013 05:08 PM Jul 18,2013 05:06 AM WPF 3
loading
Tags: Tools
Michel Cossette
Asked On July 10, 2013 05:08 PM

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.

 

 

 

 


Jegan Raj M [Syncfusion]
Replied On July 11, 2013 06:05 AM

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

Michel Cossette
Replied On July 11, 2013 05:39 PM

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:

 

    


Jegan Raj M [Syncfusion]
Replied On July 18, 2013 05:06 AM

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

CONFIRMATION

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.

;