Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
CalendarInfo binding and RangeMaxOccurrences refresh problem
posted

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.DescriptionMember = "CalendarDescription";

_calendar.DataBindingsForAppointments.StartDateTimeMember = "StartDateTime";

_calendar.DataBindingsForAppointments.EndDateTimeMember = "EndDateTime";

_calendar.DataBindingsForAppointments.RecurrenceMember = "RecurrenceMember";

_calendar.DataBindingsForAppointments.OriginalStartDateTimeMember = "OriginalStartDateTime";

_calendar.DataBindingsForAppointments.DataSource = _list;

 My _list is a List<ScheduledTask> and a ScheduleTask has the following properties used for binding:

public string Subject

{

get { return TaskName; }

}

public string CalendarDescription

{

get { return Description; }

}

public DateTime OriginalStartDateTime

{

get { return Recurrence.RecurrenceRange.StartDate; }

}

public DateTime StartDateTime

{

get { return Recurrence.RecurrenceRange.StartDate; }

}

public DateTime EndDateTime

{

get { return Recurrence.RecurrenceRange.StartDate.AddMinutes(1); }

}

public byte[ RecurrenceMember

{

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.

  • 105
    posted

    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.