Hello,
I wonder how I can add a variance of a recurring appointment programmatically. The CalendarInfo is not bound to a datasource. I expected something like: myRecurringAppointment.Recurrence.Variances.Add(new Appointment(...)), but there is no Add method.
Also some "tricks" like assigning the RecurrenceId of the root appointment to the variance isn't possible due to the missing setter of the RecurrenceId property.
So, how can I add a variance programmatically? Every help with this is highly appreciated.
Hi, I have the same requirement as you, do you have the solution?
Hi,
How to get reference to Variance because when i do like this.
var results = this._uMonthViewSingle.CalendarInfo.GetAppointmentsInRange(exPrev.ValidFrom.Value, exPrev.ValidTill.Value);
result[0].isremoved = True;
After that I get result.Count() is 0.
How it is possible to avoid losing reference to edited Appointment?
I'm trying to create appointments and its recurrences/variances programmatically and I couldn't find a way to create a variance from a recurring appointment.
Could you help me with that? If you have a sample code, that would be great.
Thanks Brian, that helps me out a lot.
An AppointmentRecurrence is based on an appointment; this appointment is referenced by the AppointmentRecurrence.RootAppointment property. That appointment does not have any physical manifestation, it is rather used as a template by which its occurrences are generated. When you change properties on the RootAppointment, those new property values are "inherited" by each occurrence that does not have a specific setting for the property, and changing the property values of the RootAppointment does not trigger variance creation.
When you double-click on a member of a recurrence and the AppointmentDialog appears, you will notice an intermediary dialog appears, prompting for whether the series or just the individual occurrence should be edited. The way this is handled internally is, when the user elects to edit the series, the AppointmentDialog edits the RootAppointment, and when they edit the occurrence , the occurrence that was generated by the recurrence is edited.