views:

16087

answers:

4

Hi Guys..I Am Having No Idea ..of Using DateTimePicker In WPF. It is Not Available in the Toolbox also. Can Any body help ?

+17  A: 

By default WPF does not come with a date time picker like winforms.

However this has now been added in the WPF tool kit produced by Microsoft which can be downloaded here. I guess it will become part of the framework in a future release.

It is simple to add a reference to the WPFToolkit.dll, see it in the tool box and distribute with your application by following the instructions on the website.

Before this was available other people had created 3rd party pickers (which you may prefer) or alternatively used the less ideal solution of using the winforms control in a WPF application.

Update: This so question is very similar this one which also has a link to a walk through for the datepicker along with other links.

John
Just a small precaution that the toolkit one is not yet ready for production: http://www.codeplex.com/wpf/Wiki/View.aspx?title=VSM%20Memory%20Leak
KP Adrian
Strike that--it was fixed in the January re-release.
KP Adrian
You're refering to the date picker not the dateTime picker. I don't think this in in the WPF Toolkit unfort.
HAdes
+2  A: 

There is no out of the box DateTime picker for WPF..

There are however a lot of third party DateTime pickers of course :)

http://www.devcomponents.com/dotnetbar-wpf/WPFDateTimePicker.aspx

http://marlongrech.wordpress.com/2007/09/11/wpf-datepicker/

http://www.codeplex.com/AvalonControlsLib

Just do a quick google to find more!

Arcturus
A: 

This just came in ;)

There is a new DatePicker class for WPF in the .NET 4.0 runtime: http://msdn.microsoft.com/en-us/library/system.windows.controls.datepicker.aspx

Also see the "Whats new in WPF" for more nice features: http://msdn.microsoft.com/en-us/library/bb613588.aspx

Arcturus
A: 

There is DatePicker in WPF Tool Kit, but I have not seen DateTime Picker in WPF ToolKit. So I don't know what kind of DateTimePicker control John is talking about.

Ivan