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
40
WebDayView not showing recurring activities
posted

Hi,

I am using a custom data provider to fetch activities to WebScheduleInfo. Everything was working fine until i used recurrence. MonthView and WeekView work fine but DayView does not show any recurring activity, but it does show any activity that is not recurring. This happens only if I use my custom provider, I have tried replacing my provider with oledbprovider e.g.
WebScheduleOleDbProvider1.WebScheduleInfo = this.WebScheduleInfo1; 
//instead of
//CustomDataProvider1.WebScheduleInfo = this.WebScheduleInfo1;
And it starts working fine.


Here is how, I am creating appointment and setting its recurrence:


privatevoid FetchActivities(FetchActivitiesContext context)
{
// Get a reference to all Appointment-related nodes in the XMLDocument
XmlNodeList nodes = scheduleXml.SelectNodes("//Results"); 
// Clear any existing activities     context.Activities.Clear();
foreach (XmlNode node in nodes)
{
// Create a new Appointment with a reference to the ScheduleInfo object that requested the fetch           
   Appointment appointment = new Appointment(this.WebScheduleInfo);
    // Configure the Appointment with the information in the data source            

   appointment.Key = node.SelectSingleNode("ListURL").InnerText;

   appointment.Subject = node.SelectSingleNode("LinkTitle").InnerText;

   #region Create Appointment's Recurrence

   // check any condition

   if (appointment.Key.Contains == "R")   {

       appointment.CreateRecurrence();

       Recurrence recurrenceObject = appointment.Recurrence;

       recurrenceObject.Period = RecurrencePeriod.Weekly;

       recurrenceObject.PeriodMultiple = 2;

       recurrenceObject.MaxOccurrences = 2;

   }

   #endregion

   appointment.StartDateTime = this.StringToDate(node.SelectSingleNode("StartDate").InnerText);

   appointment.EndDateTime = this.StringToDate(node.SelectSingleNode("_EndDate").InnerText);

   // Add the Appointment to the Activities list in the context

   ((IList)context.Activities).Add(appointment);

}

}

 Any Help?  -Thanks  Farrukh  
Parents Reply Children