The focused date for the calendar is not applied initially when setting it via code behind. If I do this via code behind: theControl.Calendar.RangeMinDate = new DateTime(2012, 1, 1); theControl.Calendar.RangeMaxDate = new DateTime(2012, 12, 31); theControl.Calendar.FocusedDate = new DateTime(2012, 1, 2); When clicking on the button to select a date, I get a "Date is out of range" message box. but then it still allows me to pick a date. The only workaround I have been able to use right now is to set the Focused date in the markup. This will allow the selection without the popup.
You are getting this exception because when you set: theControl.Calendar.RangeMinDate = new DateTime(2012, 1, 1); The current selected date is out of range, for example DateTime(2010, 2, 2); The correct way of selecting the date will be: theControl.Calendar.SelectedDate = null; theControl.Calendar.FocusedDate = null; theControl.Calendar.RangeMinDate = new DateTime(2012, 1, 1); theControl.Calendar.RangeMaxDate = new DateTime(2012, 12, 31); theControl.Calendar.FocusedDate = new DateTime(2012, 1, 2); If your old selected date is in the new range, then you dont need to make it null.