a issue delete an instance of a recurring event

4 posts, 0 answers
  1. william
    william avatar
    7 posts
    Member since:
    Dec 2010

    Posted 20 Apr 2011 Link to this post

    When i want to delete an instance of a recurring event, the fuction "theScheduler_AppointmentUpdate" will  fired . My code is as bellow ,

    void theScheduler_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
    {
      Appointment appointment = e.Appointment; 

      // People resizing 
      SPListItem li = GetListItem(appointment);
     
      if (appointment.RecurrenceState == RecurrenceState.Master)
      {
         // This means somebody try to delete an instance of recurring event                    
         RecurrenceRule recRule;
         RecurrenceRule.TryParse(appointment.RecurrenceRule, out recRule);
         if (recRule != null && recRule.Exceptions.Count > 0)
         {
            // The last exception is the DateTime of the deleted appointment
            DateTime deletedDateTime = recRule.Exceptions[recRule.Exceptions.Count - 1];
            CreateDeletedAppointment(deletedDateTime, appointment, li);
         }
       }
    }
    I find that the recRule.Exceptions always equal to 0 . Can somebody help me with this issue ? (I know that the "Exceptions" is created when we edit a recurring appointment)
  2. william
    william avatar
    7 posts
    Member since:
    Dec 2010

    Posted 22 Apr 2011 Link to this post

    I debug my code , i notice that "e.Appointment.Start" is "4/22/2006 7:00:00 AM" , actually it should be "4/22/2011 7:00:00 AM"  . Is anyone knows the reason? Any suggestion is appreciate  .
  3. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 22 Apr 2011 Link to this post

    Hello William,

    Can you examine e.ModifiedAppointment? Do you still experience problems?

    Best wishes,
    Peter
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  4. william
    william avatar
    7 posts
    Member since:
    Dec 2010

    Posted 29 Apr 2011 Link to this post

    Hi Peter ,

    you are right , i just make a mistake . thanks for your help.

    William
Back to Top