This is a migrated thread and some comments may be shown as answers.

Daily Recurrence/Every Weekday

2 Answers 89 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 27 Jun 2013, 06:44 AM
I'm trying to implement a custom recurrence dialog. Actually, due to business needs, I'm combining the the appointment dialog with the recurrence dialog. This means that I'm inheriting the EditAppointmentDialog class and so I can't also inherit the EditRecurrenceDialog class (not in VB.NET anyway).

Most of it is going well but I'm confused about something. When I create a recurrence by using the Every Weekday radio button under the Daily radio button a weekly recurrence rule for Monday - Friday with an interval of 1 is created. That makes sense. What I don't understand is why the WeeklyRecurrenceSettings.CanShowRecurrenceRule returns false in this situation. Well, what I don't understand is why your code is written to do that (I've looked at your source code). Since it's a weekly recurrence I can't use the DailyRecurrenceSettings control but since the WeeklyRecurrenceSettings control returns false for CanShowRecurrenceRule I can't use that function.

The recurrence rule should either be interpreted as a daily recurrence or else it should accept WorkDays and Interval = 1 as a valid weekly recurrence.

I'm considering implementing my own WeeklyRecurrenceSettings control but that seems like overkill.

2 Answers, 1 is accepted

Sort by
0
Timothy
Top achievements
Rank 1
answered on 27 Jun 2013, 07:28 AM
I worked around this problem by adding to some code I borrowed from Telerik's source code.

I changed this:
For Each pair As KeyValuePair(Of RadRadioButton, IRecurrenceRuleSettingsControl) In Me.radioToSettingsDictionary
    If pair.Value.CanShowRecurrenceRule(Me.RecurrenceRule) Then
        pair.Key.ToggleState = ToggleState.On
        Exit For
    End If
Next

To this:
For Each pair As KeyValuePair(Of RadRadioButton, IRecurrenceRuleSettingsControl) In Me.radioToSettingsDictionary
    If pair.Value.CanShowRecurrenceRule(Me.RecurrenceRule) Then
        pair.Key.ToggleState = ToggleState.On
        If TypeOf pair.Value Is DailyRecurrenceSettings Then
            If Me.RecurrenceRule.Interval = 1 AndAlso TypeOf Me.RecurrenceRule Is WeeklyRecurrenceRule AndAlso CType(Me.RecurrenceRule, WeeklyRecurrenceRule).WeekDays = WeekDays.WorkDays Then
                CType(pair.Value, DailyRecurrenceSettings).radioButtonEveryWeekday.ToggleState = ToggleState.On
            End If
        End If
        Exit For
    End If
Next

I run the above code after I've gotten the recurrence rule in the LoadSettingsFromEvent sub.

It would be nice if the pertinent portion of this code could be added to the DailyRecurrenceSettings.ShowRecurrenceRule sub.

0
Anton
Telerik team
answered on 02 Jul 2013, 07:48 AM
Hi Timothy,

Thank you for writing.

We highly appreciate that you brought this case to our attention. We will investigate the logic in this part of RadScheduler and we will consider your suggestion.

In regards to your workaround, it seems valid and suitable for the case that you described.

Should you have any other questions or feedback, I will be glad to assist you.

Regards,
Anton
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Scheduler and Reminder
Asked by
Timothy
Top achievements
Rank 1
Answers by
Timothy
Top achievements
Rank 1
Anton
Telerik team
Share this question
or