Hey forum:
I am databinding a CalendarInfo with the SubjectMember, DescriptionMember, StartDateTimeMember, EndDateTimeMember, RecurrenceMember, and OriginalStartDateTimeMember. Everything seems to work fine except when I use an AppointmentRecurrence that sets the RangeLimit to LimitByNumberOfOccurrences and the RangeMaxOccurrences value (any value, I usually leave it at 10). Once I add this to my binding source and do a DataBindingsForAppointments.RefreshData(), nothing shows up in my UltraMonthViewSingle control I am using to display the CalendarInfo. However, if I look at the appointments in the CalendarInfo, the newly added appointment is there. It just doesn't seem to be displayed.
I can get the new appointment to display if I add another new appointement to my binding source that does not contain the LimitByNumberOfOccurrences as the RangeLimit. Once this new appointment is added, the limited recurrence appears. However, when the it does appear, it is not 'registered' as an appointment date (I have the color set to green on DayWithActivityAppearance, and those dates are NOT green).
Here is my binding code:
_calendar.DataBindingsForAppointments.SubjectMember = "Subject";
_calendar.DataBindingsForAppointments.StartDateTimeMember = "StartDateTime";
_calendar.DataBindingsForAppointments.RecurrenceMember = "RecurrenceMember";
_calendar.DataBindingsForAppointments.DataSource = _list;
My _list is a List<ScheduledTask> and a ScheduleTask has the following properties used for binding:
{
get { return TaskName; }
}
get { return Description; }
get { return Recurrence.RecurrenceRange.StartDate; }
get { return Recurrence.RecurrenceRange.StartDate.AddMinutes(1); }
get { return Recurrence.AppointmentRecurrence.Save(); }
Recurrence (above) is my recurrence object that contains an AppointmentRecurrence. Is there something special that must be done to refresh the UltraMonthViewSingle? Any help would be greatly appreciated.
I finally figured out that the AppointmentRecurrence was not associated with an appropriate Appointment object. So, I 'create' an Appointment object and grab the AppointmentRecurrence and then associate the AppointmentRecurrence with the Appointment. Once that is done, I return the AppointmentRecurrence.Save() byte array to be bound to. This seems to have fixed this problem.