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

CreatingAppointment Event not working

1 Answer 91 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jean-Louis Lalonde
Top achievements
Rank 1
Jean-Louis Lalonde asked on 06 Mar 2012, 04:27 PM
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.

1 Answer, 1 is accepted

Sort by
0
Jean-Louis Lalonde
Top achievements
Rank 1
answered on 08 Mar 2012, 04:47 PM
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.
Tags
ScheduleView
Asked by
Jean-Louis Lalonde
Top achievements
Rank 1
Answers by
Jean-Louis Lalonde
Top achievements
Rank 1
Share this question
or