Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
12875
MonthViewSingle assigning first day of week
posted

When using UltraMonthViewSingle, some users see Sunday as the first day of the week in the month view - on the left side of the calendar, other see Monday.


 


I am not sure why since I am setting a first day of week anywhere. I tried using this line to force Sunday as the first day but it doesn’t seem to have any affect.


 


UltraCalendarInfo1.FirstDayOfWeek = FirstDayOfWeek.Sunday

  • 12875
    posted

    Derek posted a blog on this topic.  It’s specifically about the WebSchedule but regarding the FirstDayOfWeek this concept applies to WinSchedule as well.


    http://community.infragistics.com/blogs/derek_harmon/archive/2009/04/29/figuring-the-first-visible-day-on-month-view.aspx


     


    This issue involves cultural dependency and I’m guessing that you would need to set the culture as well as the FirstDayOfWeek.


     


    Culture is being read from system settings by default and that information impacts how the weekview and monthview are being presented. 


     


    You can use the WinSchedule AppointmentsCS sample if you like to see the impact.


     


    The settings on my machine are English and firstdayofweek Sunday.  If I run the sample with no changes I see that the “Month” (ultraMonthViewSingle1) and the “Work Week” (ultraWeekView1) both starting the week with Sunday,


     


    After adding the following code to the form load function of my sample, I see is the “Month” (ultraMontViewSingle1) and the “Work Week” (ultraWeekView1) both starting the week with the day that I designate 


     


    //Add Culture information to sample


    System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-US");


     


    c.DateTimeFormat.FirstDayOfWeek = System.DayOfWeek.Wednesday;


    //c.DateTimeFormat.FirstDayOfWeek = System.DayOfWeek.Monday;


     


    System.Threading.Thread.CurrentThread.CurrentCulture = c;


    System.Threading.Thread.CurrentThread.CurrentUICulture = c;