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

Binding to SelectedDates

2 Answers 229 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 2
David asked on 10 Oct 2012, 09:00 PM
Hi,

Is it possible to bind to the collection of selected dates / how would I use the selected dates in my view model?

thanks

David

2 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 16 Oct 2012, 06:28 AM
Hello David,

In the current version of RadCalendar it is not possible bind the SelectedDates to a Collection of DateTime objects. The SelectedDates property has only a Get method in order to get the selected dates in the control but it cannot be used to bind a collection to the control.

If you have any other questions do not hesitate to contact us again.

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Anthony
Top achievements
Rank 1
answered on 26 Nov 2013, 10:52 PM
I have been playing with a workaround for this limitation. 

I use a trigger on SelectionChanged: 
            <inter:Interaction.Triggers>
                <inter:EventTrigger EventName="SelectionChanged">
                    <galaSoftMvvmLightCommand:EventToCommand PassEventArgsToCommand="True" Command="{Binding ChangeCalendarSelectionCommand}" CommandParameter="{Binding SelectedDates, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadCalendar}}}" />
                </inter:EventTrigger>
            </inter:Interaction.Triggers>

which binds to a Relaycommand, and passes in an ObservableCollection<DateTime> as command parameters. Problem to overcome then is that it fires multiple times so shouldn't be used for long running task. 
Tags
Calendar
Asked by
David
Top achievements
Rank 2
Answers by
Vladi
Telerik team
Anthony
Top achievements
Rank 1
Share this question
or