Reputation: 4341
How can i disable past date in date picker?I am using ModernUI for my desktop application
<DatePicker Grid.Column="0" Name="datepicker" SelectedDate="{x:Static sys:DateTime.Now}" />
Upvotes: 1
Views: 1679
Reputation: 4341
Thanks @GauravKP for your help. I used xmlns:sys="clr-namespace:System;assembly=mscorlib" for getting Current date as
SelectedDate="{x:Static sys:DateTime.Now}"
and using DisplayDateStart="{x:Static sys:DateTime.Now}"
to hide previous date.
<DatePicker Grid.Column="0" Name="datepicker" DisplayDateStart="{x:Static sys:DateTime.Now}" SelectedDate="{x:Static sys:DateTime.Now}" ></DatePicker>
Upvotes: 1
Reputation: 614
at codebehind you can define display date like this
datepicker.DisplayDateStart = DateTime.Now;
Upvotes: 0