DateTimeEditBox What the heck am I doing wrong

Editors for WPF Forum

Posted 6 months ago by John Fisher
Version: 18.1.0675
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

Not sure of the Product Version or build number. They do not show up in the 'ActiproSoftware.Editors.Wpf' properties. The runtime version is : v4.0.30319 and the version is 17.1.650.0. My problem is pretty basic. My Xaml is as follows:

xmlns:editors="http://schemas.actiprosoftware.com/winfx/xaml/editors"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:command="http://www.galasoft.ch/mvvmlight"

            <editors:DateTimeEditBox x:Name="StartTime"
                                 Minimum="{Binding StartMinimum, Mode=OneWay}"
                                 Maximum="{Binding DateMaximum, Mode=OneWay}"
                                 Value="{Binding StartDateTime, Mode=TwoWay}"
                                 MinWidth="150">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="ValueChanged">
                    <command:EventToCommand Command="{Binding StartDateChangedCommand}"
                                            PassEventArgsToCommand="False" />
                </i:EventTrigger>
            </i:Interaction.Triggers>

        </editors:DateTimeEditBox>

The code just has 3 DateTime Properties: StartDateTime, StartMinimum, DateMaximum.

I would assume, Value would bind to the StartDateTime and it does show the initial value in the controll correctly but when you click for the dropdown it has the Maximum value selected and selecting a different value does not update either the textbox or the StartDateTime property. I have tried playing with other properties like 'CommitTriggers' and 'IsNullAllowed'. As you can see, I also tried using interactive triggers with this code

Oddly it did actually work briefly twice, like I imagined it should: Updating both the StartDateTime property and calling the StartDateChangedCommand but restarting the app, brought back the same old behavior. I am using Visual Studio 2017 Professional version 15.9.11 if that helps. 

Another issue: Before I simplified the problem, I was originally using 2 DateTimeEditBoxes and thought they might be interfering with each other since in your ProductSamples browser there is a checkbox for the control that reads "Can retain time (useful when also binding a seperate TimeEditBox)" Your source code however does not have this entry so I have no idea what property it is or if it exists at all. There is no 'CanRetainTime' or 'RetainTime' value.

On a side note your ProductSample source code is not very helpful. I would prefer it if you set up MVVM classes to bind to your controls since I imagine that is how most people code.

Comments (7)

Posted 6 months ago by John Fisher
Avatar

I did not select Silverlight controls. I am running a standard windows application.

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

Hi John,

Please try our latest 2018.1 version of Editors in case you are running into an old bug.  It seems to be working fine with databinding those three properties in the latest code.  You shouldn't need to set anything extra either.

The CanRetainTime option is only on DateEditBox, not DateTimeEditBox.  That other edit box only edits the date portion of a DateTime, so the option determines whether a time is retained or not as the date value changes.  Whereas DateTimeEditBox always edits times, so the option is not there.

We fixed the problem on the web site with the incorrect platform display.  Thanks for reporting that.


Actipro Software Support

Posted 6 months ago by John Fisher
Avatar

It is working much better after moving to 18.1. There is another more minor issue. As stated above I have 2 DateTimeEditboxes. A start time and an end time. In the example above I get a bunch of log files that have the dates and times in the file name. and by default the start time is the oldest file and the end time is the newest file. The oldest file is 4/3/2019 10:32 AM and the newest is 4/5/2019 4:36 PM. All this displays correctly. Those two dates are also the Min and Max for the DateTimeEditboxes. When I select the dropdown, the third of April is selected... but it is also not enabled. If I select April 4th, I can not ever select April 3rd again, even if the time is set to after 10:32 AM. THe Maximum does not seem to have this issue, only the Minimum. I can probably come up with a work around for this but I would consider this a bug.

Thanks for your help.

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

Hi John,

Thanks for reporting this.  Based on what you described, I suspect that the MonthCalendar is only enabling a date if its midnight time (meaning date-only) is within the minimum and maximum range.  Since you are specifying a time after midnight as the minimum, it's likely disabling that date.  We will look into it soon and will work on resolving this so it handles the situation better.


Actipro Software Support

Posted 6 months ago by John Fisher
Avatar

Thanks. That is what I figured and what I did to get the day to enable. It is odd that when it comes up a disabled day is selected.

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

Hi John,

We've fixed this for the next maintenance release.


Actipro Software Support

Posted 6 months ago by John Fisher
Avatar

Thank you.

Cheers

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

Add Comment

Please log in to a validated account to post comments.