Exception in DateTimeEditBox

Editors for WPF Forum

Posted 10 years ago by David Mullin
Version: 9.1.0502
Platform: .NET 3.5
Environment: Windows Vista (32-bit)
If I have a DateTimeEditBox control configured to show only Time - as follows:

            Format = "t";
            IsNullContentVisible = false;
            SpinnerVisibility = Visibility.Visible;
            DropDownButtonVisibility = Visibility.Collapsed;
            EditableParts = DateTimeEditableParts.Time;
If the field is empty and you click the up-arrow, I get an exception:

> mscorlib.dll!System.DateTime.AddTicks(long value) + 0xe3 bytes
mscorlib.dll!System.DateTime.Add(double value = -1.0, int scale) + 0x89 bytes
mscorlib.dll!System.DateTime.AddHours(double value) + 0x14 bytes
ActiproSoftware.Editors.Wpf30.dll!ActiproSoftware.Windows.Controls.Editors.Parts.DateTimeHourPart.c() + 0xa39 bytes
ActiproSoftware.Editors.Wpf30.dll!ActiproSoftware.Windows.Controls.Editors.Parts.DateTimeHourPart.CanDecrement.get() + 0xf3 bytes
ActiproSoftware.Editors.Wpf30.dll!ActiproSoftware.Windows.Controls.Editors.PartEditBox.OnCanExecuteDecrementValue(System.Windows.Input.CanExecuteRoutedEventArgs e = {System.Windows.Input.CanExecuteRoutedEventArgs}) + 0x84 bytes
ActiproSoftware.Editors.Wpf30.dll!ActiproSoftware.Windows.Controls.Editors.PartEditBox.c(object A_0 = {CaseTrakker.Windows.Controls.TimePicker}, System.Windows.Input.CanExecuteRoutedEventArgs A_1 = {System.Windows.Input.CanExecuteRoutedEventArgs}) + 0x46 bytes

I can provide a simple repro is needed.

David Mullin

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Hi David,

If you could send a sample that would be great. I tried the code above and I'm able to spin the hour part without error. Also, what is the actual exception?


Actipro Software Support

Posted 10 years ago by David Mullin
I've emailed the repro.
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Hi David,

I've fixed the exception that you are seeing, for the next maintenance release. Thanks for the sample.

I would recommend that you set the DateTimeEditBox.Value to something other than "new DateTime()". If you use what you have that is equal to DateTime.MinValue. So you won't be able to spin down, since that would be less than MinValue. You can use something like DateTime.Today instead, which will allow the user to spin freely in either direction.

Hope this helps.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.