Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable future dates in the Silverlight DatePicker control

I need to be able to disable the selection of future dates within the Silverlight DatePicker control - any ideas ?

like image 773
cyberbobcat Avatar asked Apr 14 '09 13:04

cyberbobcat


2 Answers

http://msdn.microsoft.com/en-us/library/system.windows.controls.datepicker.displaydateend(VS.95).aspx

DatePicker.DisplayDateEnd = DateTime.Now;

?

like image 70
nothrow Avatar answered Nov 13 '22 16:11

nothrow


Use the MaxDate to Blackout the future dates

System.DateTime DatesDisplayEnd = today.Add(duration); System.DateTime MaxDate = DateTime.MaxValue;

stkDatePicker.BlackoutDates.Add(new CalendarDateRange(DatesDisplayEnd, MaxDate));

like image 1
jagdev josan Avatar answered Nov 13 '22 17:11

jagdev josan