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

ExceptionAction

4 Answers 71 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Mark Jakes
Top achievements
Rank 1
Mark Jakes asked on 04 Jul 2011, 02:10 AM
Hello

I followed the Scheduler documentation to the letter to get ScheduleView working with RIA services and I am nearly there.  Currently I am trying to implement the code detailed in this page (http://www.telerik.com/help/silverlight/radscheduler-populating-with-data-ria-service-edit.html

There are a few things I am having a problem with.
 
1)   How do I gaurentee I get the master appointment as the demo code
 
Appointment masterAppt = e.ExceptionOccurrence.Master as Appointment;

I am currently using

Appointment editedAppt = args.Appointment as Appointment;

But I am not entirely convinced this is correct if I have just deleted an appointment in a recurrence set that is not the first (master) one.  Please advise.

2)   How do I implement the demo code

if ( e.ExceptionOccurrence == null )

Currently I am using the GetOccurrenceWithoutExceptionsFromDateTimeRange helper thus...

if (args.Appointment.GetOccurrencesWithoutExceptionsFromDateTimeRange(_visibleDateRangeSelected.Start, _visibleDateRangeSelected.End) == null)

But again, I feel I am floundering around in the dark here.

3)   The example code given in the help docs uses "switch (args.ExceptionAction)" but this does not exist in ScheduleView.  Please explain how to implement.

 

 

 

switch (args.ExceptionAction)
{
    case ExceptionAction.Add:
    case ExceptionAction.Delete:
    case ExceptionAction.Edit:
    {
        // Adding, deleting, and editing an exception are the same thing as far as
        //  RecurrenceExceptionHelper is concerned, since we are changing the exception set,
        //  all we need to do is update the serialized string and we're good to go!
        dbApptToEdit.ExceptionAppointments = RecurrenceExceptionHelper.MakeExceptionsString(masterAppt.RecurrenceRule.Exceptions.ToList<ExceptionOccurrence>());
        break;
    }
        case ExceptionAction.None:
    {
            // We're deleting or resetting the recurrence rule, so we need to reset the exceptions
                //  *** This mimics the behavior of RadScheduler
                dbApptToEdit.ExceptionAppointments = "";
                break;
    }
}


I realise the help is for Scheduler and not ScheduleView, but there is little else to go on   :-)

Can you explain or demonstrate how I implement that code block from the help page cited? 

BTW, I followed the articles that use the M2M4Ria T4 templates, but this is not suitable for our project at this present time.  The example code is a better match and I am at the final stage now so would really like to get this going  :-)

Many thanks

Mark.

4 Answers, 1 is accepted

Sort by
0
Mark Jakes
Top achievements
Rank 1
answered on 05 Jul 2011, 11:23 PM
Knock Knock, anyone home?   ;-)

I see point 1) has been answered in a similar post, http://www.telerik.com/community/forums/silverlight/scheduleview/getting-appointment-from-occurrence.aspx

Can anyone help me with the other points?

Mark.
0
Konstantina
Telerik team
answered on 07 Jul 2011, 04:04 PM
Hi Mark,

We are working on this migration. However, it will be ready some time after the Q2 release, since now we are overwhelmed by the preparation for it.

Thank you for your patience.

All the best,
Konstantina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mark Jakes
Top achievements
Rank 1
answered on 07 Jul 2011, 04:08 PM
Hi Konstantina

Thanks for the reply, I understand you and your team are busy, is there any workaround or clue you can get me started on, or do I just have to wait for this functionality to be ported?

Mark.
0
Rosi
Telerik team
answered on 13 Jul 2011, 11:33 AM
Hello Mark ,

The type of the property e.Appointment in RadScheduleView is IOccurrence. Both Appointment and Occurrence classes implement this interface. That is why you can use the type of the e.Appointment to execute the task. If it is Occurrence the edited item is exception, if it is Appointment  the edited item is not exception.

So you can try the code below:

if  (e.Appointment  is IAppointment)
{
.....
}



All the best,
Rosi
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ScheduleView
Asked by
Mark Jakes
Top achievements
Rank 1
Answers by
Mark Jakes
Top achievements
Rank 1
Konstantina
Telerik team
Rosi
Telerik team
Share this question
or