Calendar FirstDayOfWeek issue

2 posts, 1 answers
  1. Marc
    Marc avatar
    21 posts
    Member since:
    Dec 2008

    Posted 25 Feb 2009 Link to this post

    I have a calendar on a form, and user settings that allow the user to change the FirstDayOfWeek setting.  When I change the FirstDayOfWeek value at runtime the day headers update correctly, but the arrangement of the actual dates are not updated.
    I have tried..

    radCal.FirstDayOfWeek = FirstDayOfWeek.Monday

    None of this works.

    How do I force the Calendar to update correctly after a FirstDayOfWeek change?

    I am using your latest version and in VS 2008.

    Thank you.
  2. Answer
    Boyko Markov
    Boyko Markov avatar
    610 posts

    Posted 02 Mar 2009 Link to this post

    Hi Marc,

    I confirm the faulty behavior - your Telerik Points have been updated for the bug report. We will do our best to fix this issue in the upcoming major release of RadControls for Winforms.

    I have found a workaround for you - here it is:

    1. Subscribe to Calendar's PropertyChanged event
          this.radCalendar1.PropertyChanged += new PropertyChangedEventHandler(radCalendar1_PropertyChanged);

    2. In the EventHandler write the following:

            void radCalendar1_PropertyChanged(object sender, PropertyChangedEventArgs e)
                if (e.PropertyName == "FirstDayOfWeek")
                    this.radCalendar1.FocusedDate = this.radCalendar1.DefaultView.ViewStartDate.AddMonths(1);
                    this.radCalendar1.FocusedDate = this.radCalendar1.FocusedDate.AddMonths(-1);

    This code will re-create the calendar view correctly.

    Please contact me again if you have more questions regarding RadCalendar.

    All the best,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top