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

Exceptions in a recurrence rule

4 Answers 205 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 20 Dec 2012, 08:49 PM
I was wondering how exactly exceptions are stored.  In the master event's recurrence rule? 

For example, if I had deleted an occurrence of a recurring appointment, how would that be stored in a database?  Maybe something like DELETEDDATES=ddMMyyyy in the recurrence rule?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 21 Dec 2012, 12:10 PM
Hi Matt,

Thank you for your question.

The exceptions are stored as separate appointments in their MasterEvent's Exceptions collection. In the database they are stored as separate records with a pointer to their MasterEvent's id. Deleted occurrences are stored as exception appointments with Visible = false. Therefore, it is important to map the MasterEventId and the Visible properties when binding the scheduler in order to support exceptions.

I hope you find this useful. Please let me know if you have any additional questions.

Greetings,
Ivan Todorov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Matt
Top achievements
Rank 1
answered on 24 Dec 2012, 06:56 PM
Thank you for your answer!

Is it possible to programmitically create a collection of exceptions and set an Appointment's exception list to the programmatically-created list?

Thanks!
0
Allen
Top achievements
Rank 1
answered on 27 Dec 2012, 08:32 AM
foreach (Appointment App in radScheduler.Appointments)
{
    foreach (IEvent item in App.Exceptions)
    {
        //do your stuff here
    }
}

@Matt

Programatically you say? well, i think here's one way (and i know that there is a better one), i just used the existing RadScheduler control in my form to give me ALL of the appointments bound in the control, then i can just iterate through the exceptions like so. Though this is slower. Make sure that you have filled the data source of your RadScheduler first.
0
Stefan
Telerik team
answered on 27 Dec 2012, 01:53 PM
Hello Matt,

Thank you for writing back.

Yes, it is possible to do that. You need to add them to the Exceptions collection of the MasterEvent and set their MasterEvent as well.

I hope this helps.
 
Kind regards,
Stefan
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
Scheduler and Reminder
Asked by
Matt
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Matt
Top achievements
Rank 1
Allen
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or