Custom FirstDayOfWeek

2 posts, 0 answers
  1. Dan
    Dan avatar
    2 posts
    Member since:
    Jan 2012

    Posted 21 Feb 2012 Link to this post

    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
  2. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 23 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
Back to Top