This is a migrated thread and some comments may be shown as answers.

Updating the SelectedDate Value

2 Answers 65 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Dave Navarro
Top achievements
Rank 2
Dave Navarro asked on 02 Nov 2011, 07:05 PM
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 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 03 Nov 2011, 08:55 AM
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 >>

0
Dave Navarro
Top achievements
Rank 2
answered on 03 Nov 2011, 01:23 PM
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
Tags
DatePicker
Asked by
Dave Navarro
Top achievements
Rank 2
Answers by
Ivo
Telerik team
Dave Navarro
Top achievements
Rank 2
Share this question
or