Rad Scheduler Month View Appointment Template

2 posts, 1 answers
  1. Alfred
    Alfred avatar
    26 posts
    Member since:
    Jan 2008

    Posted 22 Oct 2018 Link to this post

    I am using the 2015 Q3 version.

    It is for mobile rendering.

    May I know how to accomplish this:

    In Month View, currently the appointments are displayed in a small color box.  Thus, if we have 10 appointments for a day, there are 10 boxes.

    I want to display a '10' in the day cell.

    It seems that the appointment template does not functioning in mobile month view.

     

    Thanks

    Alfred

     

     

     

  2. Answer
    Peter Milchev
    Admin
    Peter Milchev avatar
    541 posts

    Posted 24 Oct 2018 Link to this post

    Hello Alfred,

    The appointment template is not rendered in the Month view in Mobile render mode. Nevertheless, you can use the OnTimeSlotCreated event to customize the timeslot: 

    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        var scheduler = sender as RadScheduler;
        if (scheduler.SelectedView == SchedulerViewType.MonthView)
        {
            if (scheduler.ResolvedRenderMode == RenderMode.Mobile)
            {
                e.TimeSlot.CssClass += " mobile-timeslot";
            }
            var aptsPerSlot = scheduler.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End);
            e.TimeSlot.Control.Controls.Add(new Label() { Text = "Count: " + aptsPerSlot.Count });
        }
    }

    Then, you can hide the appointments in the month slots with the following styles: 

    <style>
        .mobile-timeslot .rsWrap:not(.rsDateWrap){
            display:none;
        }
    </style>

    Regards,
    Peter Milchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top