private void SetDateFormat()
{
this.gcCalendarGrid1.CurrentDate = new DateTime(2014, 2, 14);
CalendarTemplate template = new CalendarTemplate(4, 1, 2, 1);
// Displays "2月" in Japanese culture.
// Displays "February" in English culture.
template.ColumnHeader[0, 0].DateFormat = CalendarDateFormats.Month;
template.ColumnHeader[0, 0].AutoMergeMode = AutoMergeMode.Horizontal;
// Displays "金" in Japanese culture.
// Displays "Fri" in English culture.
template.ColumnHeader[1, 0].DateFormat = CalendarDateFormats.AbbreviatedDayOfWeek;
template.ColumnHeader[0, 0].AutoMergeMode = AutoMergeMode.Horizontal;
// Displays "7" in Japanese culture.
// Displays "7" in English culture.
template.RowHeader[0, 0].DateFormat = CalendarDateFormats.WeekNumber;
template.RowHeader[0, 0].RowSpan = 4;
// Displays "2014/02/14" in Japanese culture.
// Displays "2/14/2014" in English culture.
template.Content[0, 0].DateFormat = CalendarDateFormats.ShortDate;
template.Content[0, 0].DateFormatType = CalendarDateFormatType.CalendarGrid;
// Displays "2014/02/14 (先負)" in Japanese culture.
// Displays "2/14/2014 (先負)" in English culture.
template.Content[1, 0].DateFormat = "{ShortDate} ({Rokuyou})";
template.Content[1, 0].DateFormatType = CalendarDateFormatType.CalendarGrid;
// Displays "2014/2/14" in Japanese culture.
// Displays "2014/2/14" in English culture.
template.Content[2, 0].DateFormat = "yyyy/M/d";
template.Content[2, 0].DateFormatType = CalendarDateFormatType.DotNet;
// Displays "平成 26/2/14" in Japanese culture.
// Displays "平成 26/2/14" in English culture.
template.Content[3, 0].DateFormat = "ggg ee/M/d";
template.Content[3, 0].DateFormatType = CalendarDateFormatType.InputMan;
this.gcCalendarGrid1.Template = template;
}
Private Sub SetDateFormat()
Me.gcCalendarGrid1.CurrentDate = New DateTime(2014, 2, 14)
Dim template As New CalendarTemplate(4, 1, 2, 1)
' Displays "2月" in Japanese culture.
' Displays "February" in English culture.
template.ColumnHeader(0, 0).DateFormat = CalendarDateFormats.Month
template.ColumnHeader(0, 0).AutoMergeMode = AutoMergeMode.Horizontal
' Displays "金" in Japanese culture.
' Displays "Fri" in English culture.
template.ColumnHeader(1, 0).DateFormat = CalendarDateFormats.AbbreviatedDayOfWeek
template.ColumnHeader(0, 0).AutoMergeMode = AutoMergeMode.Horizontal
' Displays "7" in Japanese culture.
' Displays "7" in English culture.
template.RowHeader(0, 0).DateFormat = CalendarDateFormats.WeekNumber
template.RowHeader(0, 0).RowSpan = 4
' Displays "2014/02/14" in Japanese culture.
' Displays "2/14/2014" in English culture.
template.Content(0, 0).DateFormat = CalendarDateFormats.ShortDate
template.Content(0, 0).DateFormatType = CalendarDateFormatType.CalendarGrid
' Displays "2014/02/14 (先負)" in Japanese culture.
' Displays "2/14/2014 (先負)" in English culture.
template.Content(1, 0).DateFormat = "{ShortDate} ({Rokuyou})"
template.Content(1, 0).DateFormatType = CalendarDateFormatType.CalendarGrid
' Displays "2014/2/14" in Japanese culture.
' Displays "2014/2/14" in English culture.
template.Content(2, 0).DateFormat = "yyyy/M/d"
template.Content(2, 0).DateFormatType = CalendarDateFormatType.DotNet
' Displays "平成 26/2/14" in Japanese culture.
' Displays "平成 26/2/14" in English culture.
template.Content(3, 0).DateFormat = "ggg ee/M/d"
template.Content(3, 0).DateFormatType = CalendarDateFormatType.InputMan
Me.gcCalendarGrid1.Template = template
End Sub