How to set visible number of appointments in scheduler DayView and WeekView

4 posts, 0 answers
  1. Prava kafle
    Prava kafle avatar
    217 posts
    Member since:
    Apr 2010

    Posted 01 Sep 2011 Link to this post

    Hi,

    I would like to show only 2 appointments in each time-slot for  Week-view. If  the number of appointments exceeds 2,  I want it to show more button as in Month View.

    In Day-view, I want the time-slot to expand vertically/show scroll bars  within time-slot  as in time-line view. I want  the time-slot to expand vertically to fit all appointments rather than squeezing the appointments.

    I would also like to give a bright orange border to  whole column  representing today's date in month and view . Is it possible to acomplish above objectives, if yes, how can I do it?

    Thanks,
    Prava
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 06 Sep 2011 Link to this post

    Hi Prava,

    The first and the second functionalities cannot be implemented by design.
     
    Here is some code that looks like the third one:
    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
        {
            if (RadScheduler1.SelectedView==SchedulerViewType.MonthView)
            {
                if (e.TimeSlot.Start.Date == DateTime.Today)
                {
                    e.TimeSlot.CssClass = "today";
                }
                if (e.TimeSlot.Start.Date.AddDays(1) == DateTime.Today)
                {
                    e.TimeSlot.CssClass = "yesterday";
                }
            }
            if (RadScheduler1.SelectedView==SchedulerViewType.WeekView)
            {
                if (e.TimeSlot.Start.Date==DateTime.Today)
                {
                     e.TimeSlot.CssClass = "today";
                }
                if (e.TimeSlot.Start.Date.AddDays(1) == DateTime.Today)
                {
                    e.TimeSlot.CssClass = "yesterday";
                }
            }
        }


    .today .rsDateWrap
          {
              background-color: Red !important;
          }
          .today
          {
              border-color: Red !important;
          }
           
          .yesterday
          {
              border-right-color: Red !important;
          }

    Hope this will be helpful.

    Greetings,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Prava kafle
    Prava kafle avatar
    217 posts
    Member since:
    Apr 2010

    Posted 06 Sep 2011 Link to this post

    Hi Plamen,
    For week View, I wanted a highlighted border for  the whole column (including header)  representing today's date.Current  code and style only highlights time slot in month view and week view, how can I highlight header for todays date in month view?

    I want it to look as shown in images above.

    Thanks,
    Prava

      
  4. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 09 Sep 2011 Link to this post

    Hello Prava,

    Here is one possible way how to color the header of the current day:

    function pageLoad(args) {
                 $ = $telerik.$;
                var scheduler = $find('<%= RadScheduler1.ClientID %>');
                var count = 0;
                $(" .rsHorizontalHeaderTable th a").each(function (a) {
                    count++;
                    var t = new Date();
                    var day = t.format("#yyyy-MM-dd");
                    if (this.hash == day) {
                        $(" .rsHorizontalHeaderTable th:nth-child("+ count+ "n)").css("background-image", "none !Important");
                        $(" .rsHorizontalHeaderTable th:nth-child(" + count + "n)").css("background-color", "Red !Important");
                    }
                })
            }

    Hope this will be useful.

    Kind regards,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top