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

Custom FirstDayOfWeek

1 Answer 27 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 21 Feb 2012, 07:10 PM
Hi, i am using radscheduleview with ms lightswitch (VB.net) and i need to set the FirstDayOfWeek to be today. Is that possible? For now i am having FirstDayOfWeek="Monday".

<telerik:WeekViewDefinition DayStartTime="09:00:00"  EnableSmallAppointmentRendering="True"
                                          TimerulerMajorTickStringFormat="{}{0:h tt}:{0:mm} "
         TimerulerMinorTickStringFormat=":{0:mm}"
                                           FirstDayOfWeek="Monday"
                                         />


Thank you

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 23 Feb 2012, 02:04 PM
Hi,

You will have to set the WeekViewDefinition FirsyDayOfWeek in code behind. This could be done into the RadScheduleView UserControl constructor. Here is sample code:
public RadScheduleViewControl()
{
    InitializeComponent();
    var viewDefinitions = this.xScheduleView.ViewDefinitions;
    foreach (var viewDefinition in viewDefinitions)
    {
        if (viewDefinition is WeekViewDefinition)
        {
            viewDefinition.FirstDayOfWeek = DateTime.Today.DayOfWeek;
        }
    }

    xScheduleView.Loaded += new RoutedEventHandler(xScheduleView_Loaded);
}


Kind regards,
Ivo
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
ScheduleView
Asked by
Dan
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or