How to show only current month days in the MonthView in Radscheduler

4 posts, 0 answers
  1. shashidhar ch
    shashidhar  ch avatar
    29 posts
    Member since:
    Jun 2009

    Posted 10 Sep 2010 Link to this post


    Hi,

     

    How to show only current month days in the MonthView and NOT show the last/next few days of the previous/next month.

    Regards
    Shashi

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Sep 2010 Link to this post

    Hello Shashi,

    The following code will help you to hide other days number in RadScheduler Month view.

    CS:
    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        if (RadScheduler1.SelectedView == SchedulerViewType.MonthView)
        {
            String month = RadScheduler1.SelectedDate.Month.ToString();
            if (e.TimeSlot.Start.Date.Month.ToString() != month)
            {
                e.TimeSlot.Control.Controls.Clear();
            }
        }
    }



    -Shinu.
  3. Daniel
    Daniel avatar
    4 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2011 Link to this post

    Shinu,

    This does not work. Appointments that span over two months will be displayed in the first month and are not visible int he second months. Any other solutions to this?

    Daniel
  4. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 02 Aug 2011 Link to this post

    Hi Daniel,

    You can try this code that will hide the numbers of the slots but still show the appointments in the next month:
    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
       {
           if (RadScheduler1.SelectedView == SchedulerViewType.MonthView)
           {
     
               String month = RadScheduler1.SelectedDate.Month.ToString();
     
               if (e.TimeSlot.Start.Date.Month.ToString() != month)
               {
                   e.TimeSlot.Control.Controls[0].Controls.Clear();
               }
           }
       }

    Hope this will be helpful.

    All the best,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top