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

How to set the work week start day as sunday

1 Answer 219 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
hema
Top achievements
Rank 1
hema asked on 15 Feb 2012, 02:35 PM
Hi
i want to set work week as sunday. now my application it is displaying as monday. but i want to start work week as sunday-thrusday instead of monday-friday

Thanks
Hema

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 17 Feb 2012, 09:23 AM
Hi Hema,

Thank you for contacting us.

Currently, RadScheduler does not support modifying the default work week. However, you can use the CellFormatting event to modify the appearance of the cells so that they are displayed as work time. The following code snippet demonstrates this:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        this.radScheduler1.CellFormatting += new EventHandler<Telerik.WinControls.UI.SchedulerCellEventArgs>(radScheduler1_CellFormatting);
        this.radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Week;
    }
 
    void radScheduler1_CellFormatting(object sender, Telerik.WinControls.UI.SchedulerCellEventArgs e)
    {
        e.CellElement.IsWorkTime = (e.CellElement.Date.DayOfWeek != DayOfWeek.Saturday && e.CellElement.Date.DayOfWeek != DayOfWeek.Friday && e.CellElement.Date.Hour > 7 && e.CellElement.Date.Hour < 19);
    }
}

Please note that this will only work in DayView and WeekView where ShowWeekend is true.

I hope you find this useful. Feel free to ask if you have any additional questions.

Greetings,
Ivan Todorov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Scheduler and Reminder
Asked by
hema
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or