How to set a different background color for other month dates?

4 posts, 0 answers
  1. sabarishbabu
    sabarishbabu avatar
    136 posts
    Member since:
    Apr 2009

    Posted 27 Oct 2009 Link to this post

    Hi,
    In Scheduler month view,I want to display the dates from other months  in  a diff color than dates inthe current  month, so that it is easy for the user.
     
    For e.g.: Scheduler monthview for September 2009 shows August (30, 31) and October (1, 2, and 3). I wantto set Grey color to August and October dates. How to do this?

    p.s. the sameissue in Week view  too.

    Any clues/hints would help.
     
    Thanks
    Sabarish
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Oct 2009 Link to this post

    Hi Sabarish,

    Try the following approach in order to set the style for other month days.

    CSS:
     
    <style type="text/css"
        .OtherMonth 
        { 
            background-color: Gray  !important; 
        } 
    </style> 

    C#:
     
    protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e) 
        if (RadScheduler1.SelectedView == SchedulerViewType.MonthView || RadScheduler1.SelectedView == SchedulerViewType.WeekView) 
        { 
            String month = RadScheduler1.SelectedDate.Month.ToString(); 
            if (e.TimeSlot.Start.Date.Month.ToString() != month) 
            { 
                e.TimeSlot.CssClass = "OtherMonth"
            } 
        } 

    -Shinu.
  3. durul
    durul avatar
    4 posts
    Member since:
    Mar 2011

    Posted 03 Apr 2011 Link to this post

    how can hide other month appointments and date box ?
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 04 Apr 2011 Link to this post

    Hello Durul,

    Please take a look at this forum post for a solution.

    Kind regards,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top