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

Error Opening Recurrence of Custom Appointment

2 Answers 64 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Art Kedzierski
Top achievements
Rank 2
Art Kedzierski asked on 13 Sep 2013, 02:54 PM
I'm having a new issue with a custom appointment. I can create new and edit existing instance of the custom appointment just fine. I have written code for that during all the AppointmentCreating/Created/Editing/Edited events to populated all the custom values of the appointment (and there are a lot). The problem pops up when i try to open a recurring event, either the occurrence or the series:

A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.dll
System.Windows.Data Error: ConvertBack cannot convert value 'Recurring Event : 9/16/2013 1:00:00 PM - 9/16/2013 6:00:00 PM' (type 'Telerik.Windows.Controls.ScheduleView.Occurrence'). BindingExpression: Path='CurrentAppointment' DataItem='GlobalLabManager.ViewModels.ReserveViewModel' (HashCode=21873125); target element is 'Telerik.Windows.Controls.RadScheduleView' (Name='schedule_Appointments'); target property is 'SelectedAppointment' (type 'Telerik.Windows.Controls.ScheduleView.IDateSpan').. System.InvalidOperationException: Can't convert type Telerik.Windows.Controls.ScheduleView.Occurrence to type GlobalLabManager.Models.GLMAppointment.

I suspect its this last bit that is important. Is there a different set of events that fire for opening a recurring appointment that I don't know about?

2 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 18 Sep 2013, 11:13 AM
Hi Art,

We would need some more detailed information in order to help you further. Could you please try to isolate the issue in a runnable project and send it to us (you can open a support ticket and attach it there), so we can test the described scenario?

I'm looking forward to your response.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Art Kedzierski
Top achievements
Rank 2
answered on 24 Sep 2013, 02:03 PM
I found the error in the code. The objects in the ScheduleView are IAppointments until cast as my custom appointment type during create/edit/delete events. I was assuming the were custom objects too soon in the cycle. I thought the error was occurring on open (double-click) when it was in fact occurring on selection (single-click). The mis-cast was on my SelectedAppointment object, not the appointments.

Lesson: click slower when testing.
Tags
ScheduleView
Asked by
Art Kedzierski
Top achievements
Rank 2
Answers by
Kalin
Telerik team
Art Kedzierski
Top achievements
Rank 2
Share this question
or