Setting MonthView.VisibleAppointmentsPerDay via databound event breaking client side appointment clicked

2 posts, 0 answers
  1. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 13 Jan 2010 Link to this post

    I'm trying to update the RadSchedule.MonthView.VisibleAppointmentsPerDay property in the ScheduleDataBound event. When I do this, the schedule displays the appointments correctly, however none of the client side appointment clicked events work. If i set the property at design time, the appointment click events work.

    Below is the settings for the scheduler

    protected void Page_Load(object sender, EventArgs e) 
            GuardSchedule.DataKeyField = "ID"
            GuardSchedule.DataSubjectField = "Subject"
            GuardSchedule.DataStartField = "StartDateTime"
            GuardSchedule.DataEndField = "EndDateTime"
            GuardSchedule.SelectedView = SchedulerViewType.MonthView; 
            GuardSchedule.ShowViewTabs = false
            GuardSchedule.OverflowBehavior = OverflowBehavior.Expand; 
            GuardSchedule.ShowNavigationPane = false
            GuardSchedule.AllowDelete = false
            GuardSchedule.AllowEdit = false
            GuardSchedule.AllowInsert = false
            GuardSchedule.OnClientAppointmentClick = "AppointmentClicked";
            GuardSchedule.DataBound += new EventHandler(GuardSchedule_DataBound);

    void GuardSchedule_DataBound(object sender, EventArgs e)
            DateTime viewStartDateTime = GuardSchedule.VisibleRangeStart;
            DateTime viewEndDateTime = GuardSchedule.VisibleRangeEnd;
            _appMax = 2;
            int numApps = 0;
            DateTime startTime = viewStartDateTime;
            DateTime endTime = viewStartDateTime.AddDays(1);
            while (startTime <= viewEndDateTime)
                numApps = GuardSchedule.Appointments.GetAppointmentsInRange(startTime, endTime).Count;
                if (numApps > _appMax)
                    _appMax = numApps;
                startTime = startTime.AddDays(1);
                endTime = endTime.AddDays(1);
            GuardSchedule.MonthView.VisibleAppointmentsPerDay = _appMax;

            function AppointmentClicked(sender, eventArgs) { 
                var apt = eventArgs.get_appointment(); 
                var aptID = apt.get_id(); 
              //Do stuff with the id 
     <telerik:RadScheduler ID="GuardSchedule" runat="server" SelectedView="MonthView"

  2. T. Tsonev
    T. Tsonev avatar
    2794 posts

    Posted 18 Jan 2010 Link to this post


    Thank you for providing detailed description of the problem.

    Calling GuardSchedule.Rebind() at the end of the DataBound handler should solve the problem for the moment.

    We'll see if we can make this work without the Rebind call. Apologies for any inconvenience caused.

    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.
Back to Top