Hello,
When the Culture is set to "ar-SA" the calendar controls throw this error: "Week #N does not exist in year XXXX based on the current week rule ..."
http://i62.tinypic.com/11v1ukm.jpg
Hi Milko. If I switch to the Gregorian calendar, is there a way to have the text display in Arabic even though the calendar itself is Gregorian? In other words, have the month and day headers use Arabic text? I was able to do this in Infragistics version 12.2 (screenshot attached), but with the installation of 15.1 the old code does not automatically yield the same behavior. Maybe there are some settings I can tweak to get it to work?
-Sean
Hello Sean,
Thank you for your feedback.
.NET does not support fully UmAlQuraCalendar and Infragistics UltraWinSchedule supports only Gregorian calendars. You may use the Jorqe's solution to switch to Gregorian calendar.
Please let me know if you need any additional information.
I ran into the same problem today using Infragistics version 15.1, and so I tried the sample solution offered by Milko and find that it too throws an exception when attempting to use the Arabic (Saudi Arabia) culture with the UltraWinSchedule.UltraMonthViewSingle control. It appears that his sample solution was written for version 14.2 but is apparently not working on 15.1. It throws the following:
System.ArgumentOutOfRangeException: Week #36 does not exist in year 2015 based on the current week rule [FirstDay] and starting day of week [Saturday].Parameter name: week
and the form is displayed with a red "X" across it.
In fact, if I have my Windows region set to Arabic (Saudi Arabia) I cannot even drop the control onto a fresh form, as the exception immediately pop up.
I am hoping you can help me with a solution.
Yes, so my current solution is:
If (System.Threading.Thread.CurrentThread.CurrentCulture.Calendar.GetType() <> GetType(System.Globalization.GregorianCalendar)) Then
System.Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("en-US")
End If
Thank You.
Hello Jorge,
You may change the DateTimeFormat calendar property of CultureInfo by using such code:
Dim culture As New CultureInfo("ar-SA")
Dim calendar As New GregorianCalendar(GregorianCalendarTypes.USEnglish)
culture.DateTimeFormat.Calendar = calendar
Please note this will not change the calendar of your CultureInfo. This will only change the DateTimeFormat, e.g the way dates and times are displayed in your application. You cannot set the CultureInfo Calendar property it is read-only. More about Calendars you may find by following the next link http://msdn.microsoft.com/en-us/library/82aak18x(v=vs.110).aspx
Please find attached a sample solution and let me know if you need any further assistance.