This project has moved. For the latest updates, please go here.
4
Vote

DateTimeUpDown problem...

description

Hello! I'm trying to use DateTimeUpDown in my project.
So I have faced a problem If I use ShortTime format, the problem is:
When I selected time (minutes) I want to input for example 15, I press 1 and then 5 and something strange happen.
1) 12:00 AM
2) 12:1 AM
3) 12:5AM

I did something wrong?
I hope my images were added. =)

Image
Image

comments

Shivan149 wrote Jan 4 at 7:48 AM

Hi,

same here. Occurs in 3.0.0.
Did you find a solution?

wrote Jan 4 at 7:48 AM

BoucherS wrote Jan 5 at 4:30 PM

Hi,

This is already fixed in v3.1. You can wait for v3.1 to be released or use v3.2 "Plus" available here : https://wpftoolkit.codeplex.com/wikipage?title=Compare%20Editions.

You can also go in file Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs, and in its static constructor, add :
UpdateValueOnEnterKeyProperty.OverrideMetadata( typeof( DateTimeUpDown ), new FrameworkPropertyMetadata( true ) );
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF

SchwertJuergen wrote Mar 17 at 1:36 PM

How do i find the DateTimeUpDown.cs file and how can i modify it?
If i use "peek definition" in Visual Studio on one DateTimeUpDown control in my project it opens it from Metadata as read only, which i obviously cant edit.

Thanks for the help!

PatrickHines_SAIC wrote May 30 at 6:17 PM

Will the 3.1 fix also fix this problem for the DateTimePicker?

BoucherS wrote May 30 at 7:08 PM

Hi,

Yes, v3.1 will fix this for DateTimePicker.
DateTimePicker uses a DateTimeUpDown control.

As for the files, they can be found in the SourceCode tab on this codeplex page.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF

PatrickHines_SAIC wrote May 31 at 1:13 AM

I made the suggested update to the source and integrated. It did make things better, but still doesn't solve all the problems. Please consider the following two workflows:

Project: Simple WPF project with a single DateTimeUpDown, not data bound, with AllowTextInput=True.
  • Start
  • Use the control up/down arrows to get Monday, May 30 to show up
  • Double-click the day "30"
  • Type in "25"
  • Press the right arrow key
  • Observe that the selection is now 4 characters long, starting with the comma after the "25"
The above works as expected if you hit the enter key, but not if you hit the arrow key.
  • Start
  • Use the control up/down arrows to get a valid date/time to show up
  • Select all the text
  • Enter "7:"
  • Observe that an exception gets thrown
My expectation is that if you select all the text in the control, you can type in anything that DateTime.Parse can process, and it gets turned into a date when the Enter or Arrow Keys are pressed, or cancelled if ESC is pressed.

BoucherS wrote Jun 6 at 9:10 PM

Hi,

Following your text : __"My expectation is that if you select all the text in the control, you can type in anything that DateTime.Parse can process, and it gets turned into a date when the Enter or Arrow Keys are pressed"
__
This is already working in Toolkit v3.4.

", or cancelled if ESC is pressed.",

This will be working in Toolkit v3.5.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF