MonthCalendar resetting time

Editors for WPF Forum

Posted 9 years ago by John Dunn
Avatar
If I use the MonthCalendar directly, when the user selects a day it resets the time to be 12AM. Is there a way to stop this behavior? I assume so since the DateTime dropdown does not reset the time when the Date is selected.

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

The DateTimeEditBox merges the MonthCalendar.SelectedDate with it's current value, so the MonthCalendar isn't trying to preserve the time.

You can achieve something similar using an attached behavior. I'd create an attached property called SelectedDateTime and then bind to that. The behavior would then keep MonthCalendar.SelectedDate in sync by attaching to the MonthCalendar.SelectionChanged.

I've marked down a TODO item to see about adding this support natively, but we'd have to work out how to handle multiple selections.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 27 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.