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

All appointments on calendar are triggering only one appointments handlers

1 Answer 49 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 26 Feb 2015, 07:33 PM
I'm having a problem with the telerik:radscheduler control. I have a calendar with three appointments on it (Tuesday 12:30-1:30, Wednesday 7-4, Thursday 12:30-1:30 named ctl00_MainContent_Scheduler_1_0,ctl00_MainContent_Scheduler_0_0, ctl00_MainContent_Scheduler_2_0 respectively).

If you open or move any of the events, the only appointment that is effected is the Wednesday (ctl00_MainContent_Scheduler_0_0) appointment that is affected. If you move the Thursday event up a week, the Wednesday event is the one that's moved. Same with Tuesday, effect Wednesday. If you open any of the events for details, the Wednesday events details are populated.

I've walked the code and confirmed that the datasource is populating everything correctly.

Here's my code:

The control itself
    <telerik:RadScheduler runat="server" ID="Scheduler" SelectedView="MonthView" DayStartTime="07:00:00" DayEndTime="21:00:00"
        FirstDayOfWeek="Monday" LastDayOfWeek="Friday" AllowInsert="False" AllowDelete="False" DataKeyField="MyID" DataSubjectField="MyName"
        DataStartField="MyDate" DataEndField="MyDateEnd" OnNavigationCommand="Scheduler_OnNavigationCommand" RowHeight="50px"
        Height="100%" CustomAttributeNames="MyOtherName, MyString, MyInfo, MyLocation,TimeZoneMessage,Type,MyPlace,MyReason,MyDate, MyDateEnd" OnAppointmentDataBound="Scheduler_OnAppointmentDataBound">
        <AppointmentTemplate>
            <div>
                <%# Eval("Subject") %>
            </div>
            <div>
            <%# Eval("MyName") %>  <%# Eval("MyString") %> 
                </div>
            <%# Eval("MyInfo") %>
        </AppointmentTemplate>
        <AdvancedForm Modal="True" />
        <AdvancedEditTemplate>
            <scheduler:AdvancedForm runat="server" ID="AdvancedForm" Mode="Edit" Subject='<%# Bind("Subject") %>'
                Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' MyName='<%# Bind("MyName") %>'
                MyString='<%# Bind("MyString") %>' MyInfo='<%# Bind("MyInfo") %>' Location='<%# Bind("Location") %>'
                TimeZoneMessage='<%# Bind("TimeZoneMessage") %>' Type='<%# Bind("Type") %>' MyPlace='<%# Bind("MyPlace") %>' MyReason='<%# Bind("MyReason") %>'/>
        </AdvancedEditTemplate>
    </telerik:RadScheduler>


In the AdvancedFormTemplate.ascx.cs:

        protected Appointment Appointment
        {
            get
            {
                SchedulerFormContainer container = (SchedulerFormContainer)BindingContainer;
                return container.Appointment;
            }
        }

container.Appointment always contains the Wednesday control, even if you click on the other two.

Code behind to populate:


            Scheduler.DataSource = items;
            Scheduler.DataBind();

I've verified items contains exactly what I expect (3 separate and correct events).

When the calendar month displays, the 3 appointments each display the correct information. It's almost like they load correctly but the appointment events are tied to the Wednesday appointment handlers.

Anyone have a clue for this?

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 03 Mar 2015, 03:08 PM
Hello,

The provided code snippet seems ok. The only thing that comes to mind is that the provided appointments have the same ID. Could you confirm whether that is the case (in your post you specified the appointment names, but not the id's). If the ID's are also different, in order to pinpoint the reason for the problem we would need a runnable sample project that we can test locally, since we haven't encountered this issue before and can't point to a solution from previous encounters. So please open a support ticket and send us a runnable project, following the instructions from the following article:
http://blogs.telerik.com/supportdept/posts/10-09-29/isolating-a-problem-in-a-sample-project.aspx

Regards,
Bozhidar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
John
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or