Adding a recurring appointment in code

8 posts, 0 answers
  1. Art
    Art avatar
    54 posts
    Member since:
    Dec 2010

    Posted 15 Feb 2012 Link to this post

    When a person creates a recurring appointment, our database decodes the recurrence rule and creates an appointment for each occurrence, then saves the recurrence rule as a text string. When loading appointments the recurrence rule is not loaded because all the appointments are loaded.
    When a person edits one of those appointments we want to set the recurrence rule to the original value in case they go to edit it the values will be set.
    Currently we attempting to set the custom appointment's recurrence rule in the LoadSettingsFromEvent event of the custom apppointment form.

    tmpRule = RecurrenceRule.CreateRule(RecurrenceType.Weekly)
    tmpRule.count = 25

    appointmentWithEmail.RecurrenceRule = tmpRule


    How do we add the ByDay value, i.e. "MO,WE,FR", or the WKST value?


    Thanks
    Art
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 20 Feb 2012 Link to this post

    Hi Art,

    Thank you for contacting us.

    You can specify the week days for a weekly recurrence rule the following way:
    WeeklyRecurrenceRule weeklyRule = (WeeklyRecurrenceRule)RecurrenceRule.CreateRule(RecurrenceType.Weekly);
    weeklyRule.WeekDays = WeekDays.Monday | WeekDays.Tuesday | WeekDays.Wednesday;
    weeklyRule.Interval = 1;
    weeklyRule.Count = 25;

    I hope this will help you. Should you need further help, do not hesitate to write back.

    Greetings,
    Ivan Todorov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Art
    Art avatar
    54 posts
    Member since:
    Dec 2010

    Posted 20 Feb 2012 Link to this post

    Thanks, that should do it, however I think I found  a better way

    If dtTemp.Rows(0).Item(1).ToString <> "NA" Then  ' this is the field with the recurrence rule
        strRule = dtTemp.Rows(0).Item(1).ToString
        Dim tmpRule As RecurrenceRule
        Scheduler.ICalendar.CalHelper.TryParseRecurrenceRule(strRule, tmpRule)  ' this enters the values from the rule text
        tmpRule.Start = appointmentWithEmail.Start  ' the parser does not set the start date, so you have to do it
        appointmentWithEmail.RecurrenceRule = tmpRule   '  this adds the rule to the custom appointment
    End If

     

    It's unfortunate that I couldn't find either of these examples in your documentation.

    Thanks for the help.

     

  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 23 Feb 2012 Link to this post

    Hello,

    Thank you for your feedback.

    We will consider improving our documentation with its future updates.

    Do not hesitate to contact us whenever you have any questions related to our products.

    Greetings,
    Ivan Todorov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Saurabh
    Saurabh avatar
    1 posts
    Member since:
    May 2012

    Posted 21 May 2012 Link to this post

    Hi,
    I am developing a calendar application and I have to create custom recurring  events.But I have some UI limitations and I am not able to use EditViewController for creation and editing of the custom events.Any help will be appreciated.
    Thanks,
    Saurabh
  7. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 23 May 2012 Link to this post

    Hello Saurabh,

    Thank you for writing.

    Please note that this forum thread concerns the WinForms version of RadScheduler. You have mentioned EditViewController in your post and this makes me think that you are using RadScheduler in a web application. If this is the case, please post on the corresponding forums.

    In case you are using the WinForms version, please provide us with more details about your scenario and your requirements and we will do our best to assist you.

    Kind regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  8. Sarit
    Sarit avatar
    1 posts
    Member since:
    Apr 2013

    Posted 15 Jun 2013 Link to this post

    The name 'Scheduler' does not exist in the current context
    --- iam getting this error 
    would u please help me..
    protected override void LoadSettingsFromEvent(Telerik.WinControls.UI.IEvent ev)
            {
    if (appointmentWithEmail.tempreq != null )
                {
                    string strRule = appointmentWithEmail.tempreq;
                    RecurrenceRule tmpRule = default(RecurrenceRule);
       
            Scheduler.ICalendar.CalHelper.TryParseRecurrenceRule(strRule, tmpRule);
                 
                   
             tmpRule.Start = appointmentWithEmail.Start;
                 
                   
             appointmentWithEmail.RecurrenceRule = tmpRule;
               
                }

    }
  9. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 20 Jun 2013 Link to this post

    Hi Sarit,

    Here it where it comes from:
    Telerik.WinControls.UI.Scheduler.ICalendar.CalHelper.TryParseRecurrenceRule

    I hope this helps.
     

    Regards,
    Stefan
    Telerik
    RadChart for WinForms is obsolete. Now what?
Back to Top
UI for WinForms is Visual Studio 2017 Ready