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

Weekend in UAE is Fri & Sat

1 Answer 39 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
DMC Helpdesk
Top achievements
Rank 1
DMC Helpdesk asked on 15 Sep 2008, 10:37 AM
Hi,

We are using the scheduler control but we discovered that the weekend days are not exposed as properties.How can we modify the scheduler (skin Office2007) to display Friday and Saturday as weekend (as is in the United Arab Emirates).

This means:

-The bg color for sunday needs to be #FFFFFF and hover bg color #E9F7FC
-The bg color for friday needs to be #F4FCFF and no hover action (or stays the same)

Thanks

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Sep 2008, 09:56 AM
Hi,

Please, refer to this kb article and modify the code-behind in the sample project as follows:

protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)  
{  
    //foreach (DateTime dt in SpecialDays)  
    //{  
    //    if (DateTime.Compare(e.TimeSlot.Start.Date, dt) == 0)  
    //    {  
    //        //Set the CssClass property to visually distinguish your special days.  
    //        e.TimeSlot.CssClass = "Disabled";  
    //    }  
    //}  
    if (e.TimeSlot.Start.DayOfWeek == DayOfWeek.Friday)  
        e.TimeSlot.CssClass = "FridayStyle";         
    else if (e.TimeSlot.Start.DayOfWeek == DayOfWeek.Sunday)  
        e.TimeSlot.CssClass = "SundayStyle";  

Then, define your custom css styles in the head of the page:
div.rsContent .rsCell.FridayStyle  
        {  
            background#F4FCFF;   
        }  
        div.rsContent .rsTimelineTable .FridayStyle  
        {  
            background#F4FCFF;  
        }  
        div.rsContent .rsCell.SundayStyle  
        {  
            background#FFFFFF;  
        }  
          
        div.rsContent .rsTimelineTable .SundayStyle  
        {  
            background#FFFFFF;  
        } 


The hover style is applied via javascript on the rsAptCreate element. You can override it using the following selectors:
<style type="text/css">  
 
div.RadScheduler_Outlook .rsContentTable .rsRow .rsAptCreate,  
div.RadScheduler_Outlook .rsAllDayRow .rsAptCreate  
{  
    background:#FEFFD7;  
    border-bottom-color:#E5DDAF;  
    color:#333;  
}  
 
div.RadScheduler_Outlook .rsContentTable .rsAltRow .rsAptCreate,  
div.RadScheduler_Outlook .rsAllDayRow .rsAltRow .rsAptCreate  
{  
    border-bottom-color:#F5F5CC;  
}  
 
</style> 

To override just the Sunday slots' hover style, use:
 div.RadScheduler_Default .rsContentTable  .rsRow .rsAptCreate.SundayStyle,     
        div.RadScheduler_Default .rsAllDayRow .rsAptCreate     
        {     
            background:#FEFFD7;     
            border-bottom-color:#E5DDAF;     
            color:#333;     
        }    



Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
DMC Helpdesk
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or