none
DatePicker binding problem?

    Question

  • I wonder if anyone else has come across this issue with the DatePicker control included in "Kevin's Bag 'O tricks" ... basically when you bind to the Value property, then try and select another date from the popup calendar, it doesn't allow you to select a new date.

    For those of you who don't know, the bag o' tricks can be found at: http://wpf.netfx3.com/files/folders/controls/entry5875.aspx

    I'm binding to the DatePicker's value property like this:  

    <dc:DatePicker Name="datePicker"   
              HorizontalAlignment="Center" VerticalAlignment="Top"   
              Grid.Column="0" Grid.Row="1" Value="{Binding Path=SomeDate}"/> 

    As I mentioned already, i can not select another date from the popup calendar ... if I remove the binding, i can select whatever I want and the DatePicker performs as it should.  Anyone have any ideas why? 
    Friday, August 29, 2008 9:48 PM

Answers

  • After much debugging I finally found there was a discrepancy between DateTime objects being passed around - specifically the Time portion of the DateTime object.  I introduced a little workaround to effectively ignore the time portion and we're good to go.
    • Marked as answer by Kofoed Wednesday, September 03, 2008 5:13 PM
    Wednesday, September 03, 2008 5:13 PM

All replies

  • noone's experienced this problem?
    Tuesday, September 02, 2008 4:19 PM
  • ->  noone's experienced this problem?

    I've never used Kevin's DatePicker, but if you could provide a repro project, and send it to me at v-mazho at microsoft dot com, I will be glad to take a look at it.

    Thanks
    Wednesday, September 03, 2008 6:20 AM
  • After much debugging I finally found there was a discrepancy between DateTime objects being passed around - specifically the Time portion of the DateTime object.  I introduced a little workaround to effectively ignore the time portion and we're good to go.
    • Marked as answer by Kofoed Wednesday, September 03, 2008 5:13 PM
    Wednesday, September 03, 2008 5:13 PM