Error Opening Recurrence of Custom Appointment

3 posts, 1 answers
  1. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 13 Sep 2013 Link to this post

    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. Answer
    Kalin avatar
    1191 posts

    Posted 18 Sep 2013 Link to this post

    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.

    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 >>
  3. DevCraft banner
  4. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 24 Sep 2013 Link to this post

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