Copying (duplicating) an appointment server-side

3 posts, 0 answers
  1. Dave
    Dave avatar
    25 posts
    Member since:
    Aug 2012

    Posted 08 Feb 2010 Link to this post


    We are wondering how to access the low-level appointment data (like recordset ID or internal references) in order to duplicate a selected appointment including all its settings to a new date in timeline view (v. Q2_2009).
    We were looking at the exposed properties without finding something, but I guess we certainly missed something...

    Edit: The selection of the appointment occurs through a contextual menu.

    This has to be done server-side for technical reasons.
    Anybody has an idea?

  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 08 Feb 2010 Link to this post

    I'm assuming the property you want is the Appointment.Clone(). This will return a duplicate of the appointment object.

    Is that what you're looking for?
  3. Peter
    Peter avatar
    6637 posts

    Posted 09 Feb 2010 Link to this post

    Hi David,

    In addition to Robert's suggestion, we have recently had a question on how to copy and paste an appointment using the context menu. Here is sample code for this functionality:

    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
            <telerik:RadScheduler ID="RadScheduler1" runat="server" OnAppointmentContextMenuItemClicking="RadScheduler1_AppointmentContextMenuItemClicking"
                <AppointmentContextMenuSettings EnableDefault="true" /> 
                    <telerik:RadSchedulerContextMenu ID="RadSchedulerAppointmentContextMenu1" runat="server"
                            <telerik:RadMenuItem Text="Copy" Value="Copy"
                <TimeSlotContextMenuSettings EnableDefault="true" /> 
                    <telerik:RadSchedulerContextMenu ID="RadSchedulerTimeslotContextMenu1" runat="server"
                            <telerik:RadMenuItem Text="Paste" Value="Paste"

    protected void RadScheduler1_TimeSlotContextMenuItemClicking(object sender, TimeSlotContextMenuItemClickingEventArgs e) 
           if(Session["appointment"] != null
               Appointment a = Session["appointment"] as Appointment; 
               //The following achieves cut and paste: 
               //RadScheduler1.DeleteAppointment(a, true); 
               TimeSpan appDuration = a.Duration; 
               a.Start = e.TimeSlot.Start; 
               a.End = e.TimeSlot.Start.Add(appDuration); 
       protected void RadScheduler1_AppointmentContextMenuItemClicking(object sender, AppointmentContextMenuItemClickingEventArgs e) 
           Session["appointment"] = e.Appointment; 
       protected void Page_Init(object sender, EventArgs e) 
           XmlSchedulerProvider provider = new XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), true); 
           RadScheduler1.Provider = provider; 

    Attached is a simple demo for reference.

    Kind regards,
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top