datepicker: prevent new dates from showing up on calendars

Oct 9, 2009 at 2:28 PM

I have a DatePicker on my wpf control.  When loading it I give it a DisplayStartDate.  When you open the calendar, you can then only go back as far as that StartDate.  However, if you type a date into the DatePicker textbox which is prior to the StartDate and then open the calendar, the calendar now goes back as far as the date you typed in.

Is there a clean way to prevent this?  I tried capturing the typed in date in the DateChanged event and if it is prior to my original DisplayStartDate, then reset my DisplayStartDate and SelectedDate again to the earliest available date again.  However, I don't think it's a good user experience to type in a date and then have the control just change that date to a valid date. 

Essentially, once I set the DisplayStartDate I don't want the calendar to ever display dates prior to that, and I don't want to just changed the users start date in the textbox to a valid date.  I want there date to remain there, and then display an error message (which i've already got working).