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

[Solved] RadScheduler(Month View)

3 Answers 192 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 30 May 2008, 07:47 PM
Hello,
First off, I would like to thank you for helping me with a previous problem, the answer was faster than I expected.

Now for the dilemma...

Is there a way, in the month view, to say something like this :

if (date on calendar is before today )
{
      then make bg color of day red;
}else
{
      make bg color of day green;
}


any ideas?
i can change the css and make all the days except selectedDay be red, and vice-versa, but I can't figure out how to set colors for all the days based on today's date so that the past = red, and today & the future = green.

Thanks again for your help.

3 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 02 Jun 2008, 01:56 PM
Hello Jeremy,

You can use the TimeSlotCreated event to customize the appearance of the individual time slots (and days). For example:

protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) 
    if (RadScheduler1.SelectedView != SchedulerViewType.MonthView) 
    { 
        return
    } 
 
    if (e.TimeSlot.Start < DateTime.Today) 
    { 
        e.TimeSlot.CssClass += " rsBeforeToday"
    } 
    else 
    { 
        e.TimeSlot.CssClass += " rsAfterToday"
    } 
 

Then you can style the slots using CSS:

<style type="text/css"
    .rsBeforeToday 
    { 
        background-color: red !important; 
    } 
     
    .rsAfterToday 
    { 
        background-color: green !important; 
    } 
</style> 

Hope this helps.

All the best,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jeremy
Top achievements
Rank 1
answered on 02 Jun 2008, 03:25 PM
oops double post.
0
Jeremy
Top achievements
Rank 1
answered on 02 Jun 2008, 03:25 PM
perfect!

i knew there had to be a method that calculated the monts, but for some reason I kept looking past this one.

You guys are a great help since I do not have the time to spend figuring these things out on my own in my current time crunch.

Thanks again for a prompt reply,.
Tags
Scheduler
Asked by
Jeremy
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Jeremy
Top achievements
Rank 1
Share this question
or