Updating the SelectedDate Value

3 posts, 0 answers
  1. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 02 Nov 2011 Link to this post

    Hello,

    I would like to set the SelectedDate value via a combination of xaml binding and code as the user works with the our application. I'm able to dynamically set the value once but when I attempt to set the SelectedDate a second time (resetting it) it doesn't change. The DatePicker keeps the original SelectedDate that was set.

    Should I do something prior to "resetting" the SelectedDate value for this to work? Perhaps it's the way I'm binding? The way I'm setting it is I'm Binding the SelectedDate property in XAML and as the user selects a new record I reset the main datacontext in the code behind to the new query. Everything on the page updates as expected except the DatePicker.

    It does work the first time I navigate to a record but then once it's set it doesn't reset as I navigate to another record.

    Please let me know what I can do to correct this and thanks!

    ~ Dave
  2. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 03 Nov 2011 Link to this post

    Hello Dave Navarro,

    We tried to reproduce this without any success. You can find attached a sample example we made. Could you please edit it and send it back to us via a support ticket, so we could investigate this further?

    Regards,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 03 Nov 2011 Link to this post

    Hello,

    Thank you for the quick reply. I figured out a quick work around to my binding so I guess my issue has been resolved.
    What I did is NOT bind the DatePicker's selected date to datacontext and simply set the values in the code behind when the data (query) is complete.

    This seems to work as expected and only took two extra lines of code... so, yeah.

    I guess this will work for me.

    Thanks again for your assistance!

    ~ Dave
Back to Top