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

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

3 Answers 262 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
shashidhar ch
Top achievements
Rank 1
shashidhar ch asked on 10 Sep 2010, 10:29 AM

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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Sep 2010, 02:59 PM
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.
0
Daniel
Top achievements
Rank 2
answered on 29 Jul 2011, 05:56 PM
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
0
Plamen
Telerik team
answered on 02 Aug 2011, 04:08 PM
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.

Tags
Scheduler
Asked by
shashidhar ch
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Daniel
Top achievements
Rank 2
Plamen
Telerik team
Share this question
or