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

Recurring only on today tab

7 Answers 112 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Toon
Top achievements
Rank 1
Toon asked on 25 Jan 2010, 01:41 PM

I have built a scheduler with the telerik controls and everything went alright. But now I want to display appointments with recurrence. I'm able to add an appointment and add recurrence (save to database and databind ok). When I open my saved appointment the scheduler asks me to edit the series or just the current instance (all ok). When I open my appointment i can see that the recurrence is saved alright.

Now my problem has to do with the view of a recurring appointment. The appointment is only displayed on the day that it is created and not on the other(following) days. Now when the day begins it display all the appointments for that day (recurring. Like yesterday added). How can I let them display as long as they are recurring?

Example:
-> add appointment on (25/11).
-> Set recurring to every day
->I only see the appointment on 25/11 and not on 26/11,27/11,28/11,29/11, ...
-> When it gets to 26/11 (the day after) I’m able to see the appointment that I created on 25/11 but I don't see it on 25/11,27/11,28/11,29/11

it's get well stored and it databinds ok (checked with debugging). I can also change the recurring without any problem. I just want to now why it only displays on the today page and not on any other days

View: file

        <script type="text/javascript">  
            var selectedAppointment = null;  
     
       
                //Called when the user right-clicks an appointment  
            function appointmentContextMenu(sender, eventArgs) {  
                var menu = $find("<%= SchedulerAppointmentContextMenu.ClientID %>");  
                selectedAppointment = eventArgs.get_appointment();  
    
                // menu.show(eventArgs.get_domEvent());  
            }  
 
                //Called when the user clicks an item from the appointment context menu  
            function appointmentContextMenuItemClicked(sender, eventArgs) {  
                if (!selectedAppointment)  
                    return;  
 
                var clickedItem = eventArgs.get_item();  
                var scheduler = $find("<%= RadScheduler1.ClientID %>");  
 
                if (clickedItem.get_parent().get_text) {  
                    //The user clicked the item corresponding to the "Calendar" resource to which the appointment is assigned  
                    if (clickedItem.get_imageUrl())  
                        return;  
 
                    //Clear all resources  
                    selectedAppointment.get_resources().clear();  
                    //Find the resource corresponding to the clicked item  
                    var calendar = scheduler.get_resources().getResourceByTypeAndKey("Calendar", clickedItem.get_value());  
                    //Add it to the appointment resources collection  
                    selectedAppointment.get_resources().add(calendar);  
                    //Update the appointment  
                    scheduler.updateAppointment(selectedAppointment);  
                }  
            }      
              
            function Export(sender, e)  
            {  
                $find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, "");  
            }              
        </script> 
    </telerik:RadScriptBlock> 
          
      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
      
 
        <telerik:RadScheduler runat="server" style="z-index:1000" ID="RadScheduler1" SelectedDate="2009-06-04" FirstDayOfWeek="Monday" 
            LastDayOfWeek="Sunday" OnClientAppointmentContextMenu="appointmentContextMenu" 
            DataKeyField="ID" DataSubjectField="Subject" Height="375px" 
            DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule" 
            DataRecurrenceParentKeyField="RecurrenceParentID" AllowDelete="false" 
            OnClientAppointmentContextMenuItemClicked="appointmentContextMenuItemClicked" 
           Skin="Default" StartInsertingInAdvancedForm="True" ShowFullTime="True" EditFormTimeFormat="HH:mm" HoursPanelTimeFormat="HH:mm" MinimumInlineFormHeight="35" DataDescriptionField="Description" EnableDescriptionField="True" CustomAttributeNames="FileType,DownloadLink,Owner" DayEndTime="1.00:00:00" DayStartTime="00:00:00" WorkDayEndTime="00:00:00" WorkDayStartTime="00:00:00" Culture="(Default)">  
                <AppointmentTemplate> 
                   <u><font size="large"><%#Eval("FileType")%>:</font></u>&nbsp;&nbsp;&nbsp;<b><%# Eval("Subject") %></b><%#Eval("DownloadLink")%> 
                    <div style="text-align: right;"><asp:Button runat="server" ID="btnExport" CssClass="rsExportButton" ToolTip="Export to iCalendar" Style="cursor: pointer;cursor: hand;" CommandName="Export" OnClientClick="Export(this, event); return false;" /></div>  
                    <div>&nbsp;&nbsp;&nbsp;<%# Eval("Description") %></div>  
                </AppointmentTemplate> 
                  
                <AppointmentContextMenus> 
                    <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">  
                        <Items>                          
                            <telerik:RadMenuItem Text="Open" Value="CommandEdit" runat="server" /> 
                            <telerik:RadMenuItem IsSeparator="True" runat="server" /> 
                            <telerik:RadMenuItem Text="Delete" Value="CommandDelete" ImageUrl="~/Images/delete.gif" runat="server" /> 
                        </Items> 
                    </telerik:RadSchedulerContextMenu> 
                </AppointmentContextMenus> 
                <TimeSlotContextMenus> 
                    <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">  
                        <Items> 
                            <telerik:RadMenuItem Text="New Appointment" ImageUrl="~/Images/calendar.png" Value="CommandAddAppointment" runat="server" /> 
                        </Items> 
                    </telerik:RadSchedulerContextMenu>   
                </TimeSlotContextMenus>     
            <AdvancedForm TimeFormat="HH:mm" />         
            <MultiDayView DayEndTime="10:00:00" DayStartTime="00:00:00" /> 
            <DayView DayEndTime="1.00:00:00" DayStartTime="00:00:00" /> 
       </telerik:RadScheduler> 
 

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 25 Jan 2010, 04:11 PM
Hi Dirk,

This is the expected behavior since RadScheduler parses the recurrence rule (if any) and creates occurrences on the fly. This is done for optimization reasons. You can read more on Working with Recurring Appointments here:
http://www.telerik.com/help/aspnet-ajax/schedule_serversideworkingwithrecurringappointments.html

If there is anything in particular which you need to achieve, please elaborate and we might be able to offer a workaround.

Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Toon
Top achievements
Rank 1
answered on 25 Jan 2010, 07:06 PM
To keep this post updated:

Ok thank you for clearing this out. We would like to have the option to see the appointment recurring every day. So not only on the "today" page. We would prefer that it looks like the outlook behavior.

Referencing to your answer on the forum: When i try the online demo for radscheduler then I can create an appointment and set it recurrence. I can see it on every (recurring) day. Why can't I have this behavior? It is only visible on the "today" page. We want it visible on every day it is recurring.

Thank you for helping us with this issue

0
T. Tsonev
Telerik team
answered on 26 Jan 2010, 09:28 AM
Hi Dirk,

What you see is definitely not the normal behavior. Do you use any form of filtering in your DataSource or provider? Appointments that have recurrence rules should always be loaded as it's not clear when they occur until the rule is evaluated.

Also, can we see how a sample appointment looks in the database? With recurrence rule and everything.

Thank you.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Toon
Top achievements
Rank 1
answered on 26 Jan 2010, 09:39 AM
The recurring value is saved like this in the database:
DTSTART:20100125T030000Z
DTEND:20100125T040000Z
RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU

RecurrenceParentID: NULL
startdate: 25/01/2010 3:00:00
Enddate: 25/01/2010 4:00:00

My appointments are loaded in the page_load event. He loads the appointment correctly with the recurrence rule also. But he just displays it on the today "page" and not on the other recurring days.

Some code I use to get the appointments:

   ''' -----------------------------------------------------------------------------  
        ''' <summary>  
        ''' retrieves a collection of events from the database  
        ''' </summary>  
        ''' <remarks>  
        ''' </remarks>  
        ''' <history>  
        ''' </history>  
        ''' -----------------------------------------------------------------------------  
        Public Function GetAllevents(ByVal moduleId As IntegerAs List(Of EventInfo)  
            'Return CBO.FillCollection(Of EventInfo)(DataProvider.Instance().GetAllEvents(moduleId))  
            Dim eventlist As List(Of EventInfo) = New List(Of EventInfo)  
            Using dr As IDataReader = DotNetNuke.Data.DataProvider.Instance().ExecuteReader("EventList", moduleId)  
                While dr.Read  
                    Dim _EventInfo As EventInfo = New EventInfo  
                    _EventInfo.ModuleID = Convert.ToInt32(dr("moduleid"))  
                    _EventInfo.ItemID = dr("ItemID")  
                    _EventInfo.appointment = New Telerik.Web.UI.Appointment(dr("ItemID"), dr("StartDate"), dr("EndDate"), dr("Subject"))  
                    _EventInfo.appointment.Description = dr("Description")  
                    _EventInfo.appointment.RecurrenceRule = dr("RecurrenceRule").ToString  
                    _EventInfo.appointment.RecurrenceParentID = dr("RecurrenceParentID")  
                    _EventInfo.appointment.RecurrenceState = Telerik.Web.UI.RecurrenceState.Master  
                    _EventInfo.CreatedByUser = Convert.ToInt32(dr("CreatedByUser"))  
                    _EventInfo.CreatedDate = dr("CreatedDate")  
                    eventlist.Add(_EventInfo)  
                End While 
            End Using  
            Return eventlist  
        End Function 
0
Toon
Top achievements
Rank 1
answered on 26 Jan 2010, 09:51 AM
I solved it! I moved my fillCalendar methode (For filling my calendar) to the RadScheduler1_Init() function and now it works.
It was in page_load before with (If Not Page.IsPostBack Then)

Thank you for all your help.

Kind regards
0
Lester
Top achievements
Rank 1
answered on 04 Jul 2010, 01:46 AM
Hello.

I am using one scheduler tied to a sqldatasource and also are to see the recurring task only in the -today- view, if navigate to another day (prev,next,etc), i cant see it.

i already tried to rebind the sqldatasouce & scheduler controls in the onnavigatecommand event in codeehind  but still cant see the recurring tasks.

is there any way to show recurrig appts in ALL the days ? as OUTLOOK DOES ?

Lester
0
T. Tsonev
Telerik team
answered on 05 Jul 2010, 09:38 AM
Hi Lester,

Please make sure that you're always loading the records for appointments with set RecurrenceRule. See the sample queries in this example.

I hope this helps.

Kind regards,
Tsvetomir Tsonev
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
Tags
Scheduler
Asked by
Toon
Top achievements
Rank 1
Answers by
Peter
Telerik team
Toon
Top achievements
Rank 1
T. Tsonev
Telerik team
Lester
Top achievements
Rank 1
Share this question
or