cyberbobcat
cyberbobcat

Reputation: 1179

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 ?

Upvotes: 6

Views: 6706

Answers (2)

nothrow
nothrow

Reputation: 16168

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

DatePicker.DisplayDateEnd = DateTime.Now;

?

Upvotes: 11

jagdev josan
jagdev josan

Reputation: 11

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));

Upvotes: 1

Related Questions