How to edit date and time using date picker control?

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 11 years ago by Crile Carvey
Version: 4.5.0471
Avatar
Which control and what attributes would set a date picker up so the user can enter both date and time?

Thanks

Crile

Comments (7)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello Crile,

Please look at the DateTimePicker Intro demo in the Shared Library part of the Sample Browser. The source code for that shows the XAML for it and also what other various options do (such as IsEditable).


Actipro Software Support

Posted 11 years ago by Crile Carvey
Avatar
Thanks, but what we really want is to have a calendar control where you can click on a date, and also enter a time like 00:00 and have them both bound to the same object.

They key objective is that they are both bound to the same property, which would be of type "DateTime".

Even better would be a calendar + a digital clock with an up/down panel.

Crile
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That sample I mentioned does show how you can edit a DateTime object and enter both the date and time portions of it. The drop-down is just a MonthCalendar (no time) right now.

However that being said, we have started designing one of our next products: Editors for WPF. That will include a more robust implementation of a date/time picker, that will support things like part-based editing, up/downs, customizable drop-downs, etc. So that would probably give you what you'd like to see.


Actipro Software Support

Posted 11 years ago by Crile Carvey
Avatar
Okay, I see that. Any way to make the calendar stay dropped? In other words, have the calendar part always visible?
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
There isn't a way to force the popup to remain open. You could always use a separate MonthCalendar instance though and bind that to the same property value perhaps.


Actipro Software Support

Posted 11 years ago by Crile Carvey
Avatar
Thanks - but then we are back to square one - the bound calendar, when you choose a date, destroys the time on the bound time picker. Or is there a way around that?
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I believe the SelectedDate property on MonthCalendar retains the time when you select a day.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) 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.