A DateEdit which is set to VistaDisplayMode does not respect a set DateFormat property for the header of the control in month Display.
E.g. if you have set a CurrentCulture to DE and have set DateFormat of the VistaDateEditCalendar to EN culture then you get a control which displays everything in german except the month name in the header line which will be in english.
The fixes should be:
In DateEditCalendar.cs in Class VistaDateEditInfoArgs replace
Codepublic virtual string CaptionString {
get {
if(Calendar.View == DateEditCalendarViewType.MonthInfo)
return DateTime.ToString(CultureInfo.CurrentCulture.DateTimeFormat.YearMonthPattern);
with
Codepublic virtual string CaptionString {
get {
if(Calendar.View == DateEditCalendarViewType.MonthInfo)
return DateTime.ToString(DateFormat.YearMonthPattern, DateFormat);
You may also want to change:
public override string CurrentDateString { get { return DateTime.Today.ToString(DateFormat.LongDatePattern, DateFormat); } } public override string TimeString { get { return DateTime.Now.ToLocalTime().ToString(DateFormat.LongTimePattern, DateFormat); } }
Hello Andreas,
It is not clear what you mean by "set DateFormat of the VistaDateEditCalendar to EN culture". Please clarify your scenario in greater detail. In addition, it will be great if you provide us with a small compilable project so that we can research it on our side.
I am looking forward to your response.
Consider the following code:
VistaDateEditCalendar calendar = new VistaDateEditCalendar(base.OwnerEdit.Properties, base.OwnerEdit.EditValue);
calendar.DateFormat = new CultureInfo("pt-BR").DateTimeFormat;
If you use that calendar e.g. in a DateEdit you will get a calendar which uses the pt-BR daynames, but in the caption/header uses month-names from you CurrentCulture.
Hello Andreas,
Thank you for the clarification. I will forward this ticket to our R&D team for further research. We will update it once we obtain any news.