Binding to SelectedDates

3 posts, 0 answers
  1. David
    David  avatar
    66 posts
    Member since:
    Aug 2010

    Posted 10 Oct 2012 Link to this post


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


  2. Vladi
    Vladi avatar
    749 posts

    Posted 16 Oct 2012 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Anthony
    Anthony avatar
    1 posts
    Member since:
    Apr 2013

    Posted 26 Nov 2013 Link to this post

    I have been playing with a workaround for this limitation. 

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

    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. 
Back to Top