locked
How do I display date and time, with WPFToolkit controls? RRS feed

  • Question

  • I've downloaded and installed the latest, stable version of the WPFToolkit controls.  I've not used them before and am not that familiar with them.  It looks to me as though there is 3 different date controls: DatePicker, DatePickerFormat and DatePickerTextBox.  I need to collect both the date and the time from the user; because it's got to be stored into a datetime column in SQL Server.  How do I do that?

     


    Rod
    Wednesday, June 2, 2010 3:08 PM

All replies

  • The DatePicker should do what you need to input a date, you could use something like the link below to pick times.

    http://marlongrech.wordpress.com/2007/11/18/time-picker/

    Wednesday, June 2, 2010 4:25 PM
    Moderator
  • That TimePicker control looks promising.  I've got a couple of issues, if I use it.  First, it looks as though it includes the seconds, which I don't need.  And our users are 24-hour literate, so for example if the time is 11:30, it should allow them to enter "11:30 AM".

    And lastly how would I combine the value from the two into one value which would get stored into the database?  In ASP.NET Web Forms there's a HiddenField control, which can be databound.  Would I do something like that in WPF?  Or would I instead have to create a separate user control, which combined the 2 controls and exposed just the DateTime value?  (I guess I'd rather not work on my own user control, as I don't want to get into all sorts of other properties like exposing the background color property, etc.  But if that's what I've got to do, then OK.)

     


    Rod
    Wednesday, June 2, 2010 4:56 PM