My project still uses Telerik v2011.1.413.35 and came across an issue with the recurrence editor. Here are the settings:
Recurrence: Hourly
Recur every: 1 hr
Repeat end: End By
End by: 10/3/2018
The above setting when configured in UI or preset at Page_Load always generates and stops at only 3000 occurrences. I tried setting/overriding RadSchedulerRecurrenceEditor.RecurrenceRule.MaximumCandidates and RadSchedulerRecurrenceEditor.RecurrenceRule.Range.MaxOccurrences during Page_Load or on click/submit of form, before accessing Occurrences property, as suggested in these forum topics: Link 1, Link 2. That does not work.
So, I went ahead and installed the latest Telerik UI for ASP.NET AJAX, and tried the same experiement a fresh, simple page that only has the recurrence editor, and still does not work. Below is the code snippet, both ASPX and VB page.
01.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RecurrenceEditor.aspx.vb" Inherits="RecurrenceEditor" %>
02.
03.
<!DOCTYPE html>
04.
05.
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
06.
<
head
runat
=
"server"
>
07.
<
title
></
title
>
08.
<
telerik:RadStyleSheetManager
id
=
"RadStyleSheetManager1"
runat
=
"server"
/>
09.
</
head
>
10.
<
body
>
11.
<
form
id
=
"form1"
runat
=
"server"
>
12.
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
13.
<
asp:Panel
ID
=
"pnlRadRecurrenceEditorTest"
runat
=
"server"
CssClass
=
"ssection"
Width
=
"600"
>
14.
<
telerik:RadSchedulerRecurrenceEditor
ID
=
"radRecurEditor"
runat
=
"server"
></
telerik:RadSchedulerRecurrenceEditor
>
15.
<
asp:Button
ID
=
"btnRadRecurrenceEditorSubmit"
runat
=
"server"
Text
=
"Schedule Submit"
/><
br
/>
16.
<
asp:Label
ID
=
"lblRadRecurrenceEditorDetails"
runat
=
"server"
></
asp:Label
>
17.
</
asp:Panel
>
18.
</
form
>
19.
</
body
>
20.
</
html
>
01.
Imports
Telerik.Web.UI
02.
03.
Partial
Class
RecurrenceEditor
04.
Inherits
System.Web.UI.Page
05.
06.
Protected
Sub
Page_Load_Recurrence(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Handles
Me
.Load
07.
lblRadRecurrenceEditorDetails.Text =
String
.Empty
08.
If
IsPostBack
Then
Exit
Sub
09.
'NOTE: With or without the below code commented, I cannot get occcurrences > 3000 in count
10.
Dim
endDate
As
New
Date
(2018, 10, 4)
11.
radRecurEditor.StartDate = Now()
12.
radRecurEditor.EndDate = endDate
13.
radRecurEditor.RecurrenceRule =
New
HourlyRecurrenceRule(1,
New
RecurrenceRange(Now(), TimeSpan.Zero, endDate, 0))
14.
radRecurEditor.RecurrenceRule.Range.MaxOccurrences = 10002
15.
radRecurEditor.RecurrenceRule.MaximumCandidates = 10001
16.
lblRadRecurrenceEditorDetails.Text +=
"<br>Max occurrences: "
& radRecurEditor.RecurrenceRule.Range.MaxOccurrences.ToString()
17.
lblRadRecurrenceEditorDetails.Text +=
"<br>Max candidates: "
& radRecurEditor.RecurrenceRule.MaximumCandidates.ToString()
18.
End
Sub
19.
Protected
Sub
btnRadRecurrenceEditorSubmit_Click(sender
As
Object
, e
As
EventArgs)
Handles
btnRadRecurrenceEditorSubmit.Click
20.
Dim
output
As
New
List(Of
String
)
21.
output.Add(
"Max candidates: "
& radRecurEditor.RecurrenceRule.MaximumCandidates.ToString())
22.
radRecurEditor.RecurrenceRule.MaximumCandidates = 10000
'doesn't work
23.
output.Add(
"Max candidates changed to: "
& radRecurEditor.RecurrenceRule.MaximumCandidates)
24.
output.Add(
"Max occurrences: "
& radRecurEditor.RecurrenceRule.Range.MaxOccurrences.ToString())
25.
output.Add(
"ToList count: "
& radRecurEditor.RecurrenceRule.Occurrences.ToList().Count)
26.
output.Add(
"Total count: "
& radRecurEditor.RecurrenceRule.Occurrences.Count)
27.
output.Add(
"Last recurring date: "
& radRecurEditor.RecurrenceRule.Occurrences.LastOrDefault())
28.
lblRadRecurrenceEditorDetails.Text =
String
.Join(
"<br>"
, output)
29.
End
Sub
30.
31.
End
Class
I have also attached the resultant page view.
Let me know what I'm doing wrong here, or if this is an actual bug in the tool.
Thanks.