CreatingAppointment Event not working

2 posts, 0 answers
  1. Jean-Louis Lalonde
    Jean-Louis Lalonde avatar
    7 posts
    Member since:
    Jun 2010

    Posted 06 Mar 2012 Link to this post

    Hello,

    I've been trying to get the CreatingAppointment Event to work for a while now without any luck. 

    Here is my code
    <Common:MainPageBase
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:schedule="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
    xmlns:scheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView">

    <telerik:RadScheduleView x:Name="scheduler" Grid.Row="3" 
    AppointmentCreating="scheduler_AppointmentCreating"
    AppointmentEditing="scheduler_AppointmentEditing" 
    AppointmentEdited="scheduler_AppointmentEdited" AppointmentDeleting="scheduler_AppointmentDeleting" 
    AppointmentsSource="{Binding EventList}">
            <scheduleView:RadScheduleView.ViewDefinitions>
            <scheduleView:WeekViewDefinition />
    <scheduleView:MonthViewDefinition />
    <scheduleView:TimelineViewDefinition DayStartTime="00:00" />
    </scheduleView:RadScheduleView.ViewDefinitions>

    <telerik:RadContextMenu.ContextMenu >
                    <telerik:RadContextMenu>
    <telerik:RadMenuItem Header="New Appointment..." Command="schedule:RadScheduleViewCommands.CreateAppointment"  />
                        </telerik:RadContextMenu>
                    </telerik:RadContextMenu.ContextMenu>
                </telerik:RadScheduleView>
    </telerik:RadScheduleView>
    </Common:MainPageBase>

    I've tried removing the events to see if the default commands would take effect, but no luck. The context menu appears, by clicking on the item never triggers the events. I've been thinking that it may be related to the control templates, but the examples I've been seeing don't include any templates.

    I must say at am at a loss.

    Thanks in advance for any help.
  2. Jean-Louis Lalonde
    Jean-Louis Lalonde avatar
    7 posts
    Member since:
    Jun 2010

    Posted 08 Mar 2012 Link to this post

    Ok, got it to work.

    When assigning an ObservableCollection to the AppointmentsSource property, you must absolutely instanciate it as follows:

    ObservableCollection<Appointment>      yourCollection;

    If you do the following:

    ObservableCollection<YouAppointmentClass>      yourCollection; 

    Where YouAppointmentClass inherits from Appointment, CreateAppointment will simply not work.

    It's a limitiation in Silverlight apparently, not Telerik.
  3. DevCraft banner
Back to Top