lifeistoprogram
lifeistoprogram

Reputation: 23

how to pick date and time in WPF/c#

I'm new to WPF, i want to implement UI to select both date and time from the user at a time, How can achieve this?

I tried with below code -

 <DatePicker SelectedDate="{Binding Date, StringFormat='dd/MM/yyyy HH:mm:ss'}"/>

Not able to achieve, kindly requesting you to help me out?

Thanks,

Upvotes: 2

Views: 6991

Answers (1)

Hammas_Stack1
Hammas_Stack1

Reputation: 182

Use the extended DateTimePicker . The DatePicker control does not deal with time, only dates. So you will need to use a different control.
Install Extended WPF Toolkit via NuGet packages in your project. and the use it like default DatePicker. But this has some extra properties, mentioned here DateTimePicker. use them according to your requirement.

Upvotes: 3

Related Questions