DateEditBox.CanRetainTime doesn't seem to work

Editors for WPF Forum

Posted 7 years ago by Ralph
Version: 17.1.0651
Platform: .NET 4.5
Environment: Windows 7 (64-bit)
Avatar

DateEditBox has a property called CanRetainTime.  According to the documentation if it is set to true, the time portion of the bound DateTime should be preserved when we change the date.  This doesn't seem to work.

In the ViewModel I have a DateTime property.

In the View I have a DateEditBox (with CanRetainTime set to true) and a TimeEditBox, both bound to the same DateTime property.

When I change the date in the DateEditBox, the time is reset to mindnight.

 

EDIT: next week I'm going on holiday and I may be unable to respond until 10th July.

[Modified 7 years ago]

Comments (8)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

Thanks for letting us know.  We've fixed it for the upcoming maintenance release later this month.


Actipro Software Support

Posted 7 years ago by Ralph
Avatar

Fixed, but there is still a situation when it doesn't work: if you open the drop down calendar of a DateEditBox and click "today", the time of day still resets to midnight.

BTW, in my opinion clicking a day in the drop down calendar should close it.  Now when the user clicks some day (or "today"), nothing happens and he has to click somewhere outside the calendar to close it. Even double clicking doesn't close the calendar. Not very intuitive...

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

Good catch on the Today button.  We'll update that for the next version, which will likely be the 2017.2 version.

As for the auto-close on click.  I tend to agree that it's not ideal for a pure date picker popup right now.  The main reason it's like it is now is that for a date/time picker, we can't really close it on selection changes.  But perhaps in date-only mode, it should close? 

To confirm, it would only close on day click/Enter or pressing the Today button, right?  How about if the user clicks a day outside of the current month (where normally it would scroll to the new month)... should it close there too or stay open and scroll?


Actipro Software Support

Posted 7 years ago by Ralph
Avatar

A double click should definitely close the popup calendar, it's a no brainer.

With single clicks things start to be more complicated.  I didn't notice that clicking a day outside current month scrolls the calendar.  Hmmm...  Well, I think it shouldn't matter - clicking a normal day should close the calendar and clicking a day "outside" should scroll to next/previous month. It should still feel natural. Of course, I'm talking about the date-only mode, the nature of a date/time popup excludes any closing on selection.  Maybe the closing behaviour should be controlled by some property and DateTimeEditBox would set it to "don't close" and in case of DateEditBox the developer could choose his preferred behaviour?

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

For the next version, we will update DateEditBox clicks on popup calendar days in the current month and also Enter presses to close the popup.  Thanks for the suggestion.


Actipro Software Support

Posted 7 years ago by Ralph
Avatar

Fantastic!

Thanks a lot!

Posted 6 years ago by Ralph
Avatar

I'm refreshing the old conversation, because CanRetainTime is broken again in version 2017.2 build 0665.

1. Create two bound editors:

    <StackPanel Orientation="Vertical">
        <editors:DateEditBox Value="{Binding SimulationTime}" CanRetainTime="True"/>
        <editors:TimeEditBox Value="{Binding SimulationTime}"/>
    </StackPanel>

 SimulationTime is a DateTime property in the ViewModel.

2. Run the application

3. Change the date to any other than today

4. Change the time.

As soon as you change the time, the date gets reset to today.

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

Thanks for letting us know.  Actually this is the opposite scenario from before since this is the TimeEditBox not retaining date.  We added code for the next build to fix that.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.