Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > How do I get the selected occurrence in a recurring series?

Not answered How do I get the selected occurrence in a recurring series?

Feed from this thread
  • Paula Bianca avatar

    Posted on Jun 20, 2011 (permalink)

    I created an appointment date June 13, 2011 (with start time 8:00 AM - 8:30 PM) and this appointment will recur daily until June 17, 2011.
    RadScheduler properly displayed my appointments from June 13 - June 17 on the given time slot.

    We have a wrapper class which inherits the AppointmentBase class from telerik radscheduler to represent each appointment. If an appointment is recurring, we just apply the necessary recurrence rule. 

    In the AppointmentEditing event, I display our custom edit dialog. I double-clicked the occurrence on June 15, and it successfully displayed our custom edit dialog. I am able to retrieve our original data for the appointment (which has the appointment date June 13 as saved in the database), but I cannot seem to find where I can get the date of the selected occurrence, which is June 15. 

    I hope you guys can point me out how we can get this information. Thank you!

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Jun 23, 2011 (permalink)

    Hi Paula,

    Unfortunately, this is not possible with the current implementation of the RadScheduler. However, this can be achieved with our new scheduling control - RadScheduleView. You can check out its online demos here.

    Hope this information helps.

    All the best,
    Konstantina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Paula Bianca avatar

    Posted on Jun 29, 2011 (permalink)

    May I say that there IS a way to retrieve the occurrence appointment. I was able to get it via the argument parameter passed during the AppointmentEditing or AppointmentDeleting event. There is an Appointment object returned in the AppointmentEditingEventArgs or AppointmentDeletedEventArgs. 

    For all those who were looking for the answer, here it is. ^_^

    Reply

  • Brian avatar

    Posted on Feb 9, 2012 (permalink)

    Hi Paula (or Telerik team),

    Can you please give a code snippet of the method you used to get the occurrence appointment?
    Is this server side or client side?

    Best Regards,

    Brian

    Reply

  • Brian avatar

    Posted on Feb 9, 2012 (permalink)

    Hi All,

    Managed to get at particular occurence data of a recurring appointment in my user control.
    The real pain was identifying the hidden server-side input control within the javascript in order to set this server side hidden control(s) to the occurrence appointment data i.e. set input (id="start") to the occurrence start date.
    Hope this helps someone.
    Any questions give me a shout.
    UserControl.ascx

    <div>

    <

    input type="hidden" id="start" name="start" value="" runat="server"/>

    <

    input type="hidden" id="end" name="end" value="" runat="server"/>

     

    <script type="text/javascript">

     

    function RadScheduler1_AppointmentEditing(sender, eventArgs)

     {

     

    //if (!eventArgs.get_editingRecurringSeries())

     

    //eventArgs.set_cancel(true);

     

    var appt = eventArgs.get_appointment();

     

    var Start = new Date(appt.get_start());

     

    var End = new Date(appt.get_end());

     

    var h = Start.getHours();

     

    var Hours = (h < 10) ? '0' + h : h;

     

    var mi = Start.getMinutes();

     

    var mins = (mi < 10) ? '0' + mi : mi;

     

    var s = Start.getSeconds();

     

    var secs = (s < 10) ? '0' + s : s;

     

    var d = Start.getDate();

     

    var day = (d < 10) ? '0' + d : d;

     

    var m = Start.getMonth() + 1;

     

    var month = (m < 10) ? '0' + m : m;

     

    var yy = Start.getYear();

     

    var year = (yy < 1000) ? yy + 1900 : yy;

     

    var startDate = year + "-" + month + "-" + day + " " + Hours + ":" + mins + ":" + secs;

    document.getElementById(

    'ctl00_MasterPageContentPlaceHolder_EDS_Calendar_start').value = startDate;

     

    //alert(document.getElementById('ctl00_MasterPageContentPlaceHolder_EDS_Calendar_start').value);

    }

     

     

    </script>

    Code behind:

     

     

     

     

     

     

    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)

    {

     

    // Disable the LastModified textbox in the advanced form

     if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)

     

    if (start.Value != "" && start.Value != null)

     {

     

    AppointmentManager.OccurenceDate = Convert.ToDateTime(start.Value);

    }

     

     

     

     

     

    Reply

  • Brian avatar

    Posted on Feb 9, 2012 (permalink)

    Thanks Paula for putting me onto my solution

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > How do I get the selected occurrence in a recurring series?
Related resources for "How do I get the selected occurrence in a recurring series?"

WPF Scheduler Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]