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

Automatically Selecting Day of Week

1 Answer 65 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Chris Andrews
Top achievements
Rank 1
Chris Andrews asked on 01 Oct 2011, 03:43 PM
Hello All,

We have a requirement where the SelectedDate must be a Saturday only.  We are using the MVVM pattern.  I am able to change the SelectedDate property to the Saturday, however when I re-open the calendar, the last day of week the user clicked is still highlighted.  How can I remove the highlighting, even though the SelectedDate has already been changed properly.

For example, say the user clicks Oct 11 (a Tuesday), I want Oct 15 (Saturday) to be highlighted, not Oct 11.

As I mentioned, the actual SelectedDate property is set just fine, it's the highlighted date I can not figure out how to remove.

I can provide a simple test project if needed.

Here is a screenshot of the issue.  Note the Date in the control, and what's highlighted.
http://i865.photobucket.com/albums/ab216/CA-Psycho/Public/CalendarIssue.png

Thanks,
Chris

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 04 Oct 2011, 03:53 PM
Hello Chris,

 This happens as you set the SelectedDate property while it is updating so the change is not populated back to the calendar. To overcome this problem I would suggest you to update the value after a moment using the dispatcher.BeginInvoke method (or at least to postpone the property change notification using the same approach).

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team

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

Tags
DateTimePicker
Asked by
Chris Andrews
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or