WPF Toolkit March 2009 - DatePicker / Calendar still not working properly

Apr 2, 2009 at 3:35 PM
Edited Apr 2, 2009 at 3:38 PM
I've just started using the new DatePicker and Calendar controls from the latest release of the WPF Toolkit.  I was previously looking at the January release and found that the controls were so buggy that they were unusable.  This has been half fixed, but there is still a serious problem with them.

If I navigate to a particular month then select a day from within that month, then everything is fine, but if I select one of the visible dates from the end of the previous month or the start of the next month, the date selected is never correct.  For example, I am currently looking at February 1999, which displays the days from 25/01/1999 to 07/03/1999.  I click on 27/01/1999, but when the calendar closes, the DatePicker is displaying the date 30/12/1998 - it has jumped back an entire month from the date I selected.  I go back to February again and this time click on 04/03/1999, but the date selected once the calendar closes is 01/04/1999 - this time it has jumped a month ahead of the date I selected.  Was this ever tested??? 

I really do like this control and would use it a lot if it actually worked, but this bug has been there since the previous version and I'm getting the feeling that if I want to use the control I'm going to have to fix it myself, which I might not have time to do given our current project deadlines.

Has anyone else noticed this bug and has it already been logged as something that needs to be fixed?

Apr 2, 2009 at 3:57 PM
It turns out that this problem only occurs if you set the SelectedDate and the DisplayDate.  I thought that binding them both to the same property on my class would be fine, but it obviously isn't.

What is the difference between DisplayDate and SelectedDate?  If I just bind the SelectedDate to my DateTime property on my object then it seems to work fine, but if I bind the DisplayDate as well I get the problem described above.

Sorry if I sounded like I was having a rant before, it's just been one of those days!