Recurrence Support in Scheduler

7 posts, 0 answers
  1. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 15 Nov 2011 Link to this post

    Hi,

    I have got a custom Appointment class (JobAppointment), which works off a database, has recurrence support and works well with the windows version of the RadScheduler.

    Now, we want to provide the same functionality in the web version. We want to keep the database structure and content common between the two versions, but the Appontment class can change between the two versions.

    We are currently able to work with Appointments in the web version, but the Appointments with recurrence rules are no different to the normal appointments. Appointment occurences for an appointment with recurrence are currently not being shown in the scheduler.

    In cases like this, it is perhaps best to demonstrate with an example.

    Database Fields/Appointment Class Properties:
    • ID: 79
    • DateStart: 5/10/2011 10:00:00 AM
    • DateEnd: 5/10/2011 11:00:00 AM
    • Description: Email tagging dept filter
    • Comment: This should default to a department specified by the user in the options.
    • RecurrenceRule: FREQ=DAILY;COUNT=5
    • ParentID: 0

    The Scheduler is set up as follows:

    RadScheduler1.DataKeyField = "ID"
    RadScheduler1.DataStartField = "DateStart"
    RadScheduler1.DataEndField = "DateEnd"
    RadScheduler1.DataDescriptionField = "Comment"
    RadScheduler1.DataSubjectField = "Description"
    RadScheduler1.DataRecurrenceField = "RecurrenceRule"
    RadScheduler1.DataRecurrenceParentKeyField = "ParentID"
     
    RadScheduler1.DataSource = mColAppointments
    RadScheduler1.DataBind()

    Note that mColAppointments is the List(Of JobAppointment) - a collection of Appointment objects.

    There are two Issues I can see with the above:

    1. The recurrence rule is in the format used by the windows version. This is probably not being interpreted correctly by the web version. Therefore, I do not see the 5 occurrences from this appointment.
    2. The ID and ParentID are long fields, therefore absence of a parent ID is represented by 0. Unlike the windows version, the web version is treating as if all appointments are appointment occurences. Therefore it displays the "Edit this occurence or Edit the series" dialog.

    In both cases, I think the solutiion might lie in doing some sort of translation when reading and writing the recurrence rule and parent id to/from the database. But I am not sure what exactly is required here.

    PS - I have not submitted a support ticket as I thought this may be useful to others using this forum.

    Any help much appreciated.
    Regards.

  2. Plamen
    Admin
    Plamen avatar
    3048 posts

    Posted 21 Nov 2011 Link to this post

    Hello Richard,

     
    You can take a look at this help topic where is shown the RadScheduler's database structure. Please have in mind that when the appointment do not have a parent, the parentID field should be Null. Otherwise the appointment is treated as an occurrence. 

    One other thing is that the recurrence rule have to be in a proper format. Otherwise it won't be read. Here you can see a help topic about it.

    Hope this will be helpful. 
    All the best,

    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 23 Nov 2011 Link to this post


    Thanks Plamen,

    You have just confirmed what I had posted.

    Regarding parentID being Null, thats fine.. I can do some sort of transalation that assigns a null to parentID if 0.

    With the recurrence rule, however, I would have thought a few Telerik clients would be using the windows and the web version accessing  common data - hence there would be a need for common recurrence rule representation, (or at least some provision for translating between the two versions)??



  4. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 27 Nov 2011 Link to this post


    Is there a translation algorithm which allows translating recurrence rule text from the WinForms version to the ASP.NET AJAX version and vice versa? I know a few people have attempted this, but it would be nice to get a standard function from Telerik which achieves this.

    Regards,
  5. Plamen
    Admin
    Plamen avatar
    3048 posts

    Posted 28 Nov 2011 Link to this post

    Hi Richard,

    There is no such transformation algorithm and we will consider your recommendation.
     
    RadScheduler for ASP.NET AJAX follows the
    Internet Calendaring and Scheduling Core Object Specification. It would require a different recurrence rule for the appointment in question than the one you use for the WinForms scheduler. Here is what would work:

    "DTSTART:20111128T100000Z\r\nDTEND:20111128T110000Z\r\nRRULE:FREQ=DAILY;COUNT=5;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU"

    The easiest way to check what would be the recurrence rule for the web scheduler is to create a simple sample with XmlSchedulerProvider using 
    Telerik VSX  (http://screencast.com/t/EE4BxUcMY7). Then you can create recurring appointments and examine the Appointments.xml file.




    Greetings,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 29 Nov 2011 Link to this post


    Thanks for the prompt reply.
    Is there a time frame for considering my recommendation?

    I see that other people have posted regarding this.
    http://www.telerik.com/community/forums/aspnet-ajax/scheduler/recurrenceruletostring.aspx
    http://www.telerik.com/community/forums/winforms/scheduler/regarding-recurrentce-rule-format.aspx
    So I am not alone who requires a way to translate recurrence rules between the two versions.

    References from other people who have attempted parsing the recurrence rule:
    http://www.telerik.com/community/forums/aspnet-ajax/scheduler/scheduler-recurrence-patterns-and-exchange-recurrence-rules.aspx
    http://www.telerik.com/community/forums/aspnet-ajax/scheduler/regular-expression-to-parse-recurrencerule.aspx
    The solutions here do not really instill confidence that all scenarios are dealt with and tested as outlined in Internet Calendaring and Scheduling Core Object Specification.

    I guess my reservation in attempting to translate between the two versions is that it is hard to test all the different scenarios outlined in Internet Calendaring and Scheduling Core Object Specification. It would be better if Telerik (in the absence of standard recurrence rules between the WinForms and ASP.NET AJAX suites) provide people like us with some means of translating between the two versions in a reliable way. This would also make the scheduling components more appealing to developers - as recurrence rules would then be compatible between the WinForms and ASP.NET AJAX suites.

    Regards.
  7. Plamen
    Admin
    Plamen avatar
    3048 posts

    Posted 29 Nov 2011 Link to this post

    Hi Richard,

    Thank you for sharing these forum posts and the observations.

    I have inspected furthermore the issue and the differences between both recurrence rules. The workaround that I came to is to change the "winforms" rule in the onAppointmentDataBound event of the "ASP" scheduler. Here is the code that I implemented and tested in several cases and worked properly:
    if (e.Appointment.RecurrenceState == RecurrenceState.Master)
            {
                DateTime start = e.Appointment.Start;
                string stringStart = start.ToString("yyyyMMdd") + "T" + start.ToString("hhmmss") + "Z";
                DateTime end = e.Appointment.End;
                string stringEnd = end.ToString("yyyyMMdd") + "T" + end.ToString("hhmmss") + "Z";
                string givenrecRul = "FREQ=MONTHLY;BYMONTHDAY=10;WKST=SU";
                if (!givenrecRul.Contains("INTERVAL"))
                {
                    givenrecRul = "INTERVAL=1;" + givenrecRul;
                }
                if (!givenrecRul.Contains("BYDAY"))
                {
                    givenrecRul = "BYDAY=MO,TU,WE,TH,FR,SA,SU;" + givenrecRul;
                }
                e.Appointment.RecurrenceRule = "DTSTART:" + stringStart + "\r\nDTEND:" + stringEnd + "\r\nRRULE:" + givenrecRul;
            }

    Hope this will be useful. If you have some questions or you find some cases where it is not working properly please let us know.

    Best wishes,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top