private CalendarTemplate CreateTemplate()
{
GrapeCity.Win.CalendarGrid.CalendarTemplate calendarTemplate1 = new GrapeCity.Win.CalendarGrid.CalendarTemplate();
GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType1 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType2 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType3 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType4 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
calendarTemplate1.ColumnCount = 2;
calendarTemplate1.ColumnHeaderRowCount = 2;
//The first column is not allowed to resizing.
calendarTemplate1.ColumnHeader.Columns[0].AllowResize = false;
calendarTemplate1.RowCount = 2;
calendarTemplate1.RowHeaderColumnCount = 0;
calendarTemplate1.ColumnHeader.CellStyleName = "defaultStyle";
calendarTemplate1.ColumnHeader.GetCell(0, 0).CellType = calendarHeaderCellType1;
calendarTemplate1.ColumnHeader.GetCell(0, 0).DateFormat = "Resize Me";
calendarTemplate1.ColumnHeader.GetCell(0, 0).RowSpan = 1;
calendarTemplate1.ColumnHeader.GetCell(0, 0).ColumnSpan = 2;
calendarTemplate1.ColumnHeader.GetCell(0, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter;
calendarTemplate1.ColumnHeader.GetCell(0, 1).CellType = calendarHeaderCellType2;
calendarTemplate1.ColumnHeader.GetCell(1, 0).CellType = calendarHeaderCellType3;
calendarTemplate1.ColumnHeader.GetCell(1, 0).Value = "AM";
calendarTemplate1.ColumnHeader.GetCell(1, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter;
calendarTemplate1.ColumnHeader.GetCell(1, 1).CellType = calendarHeaderCellType4;
calendarTemplate1.ColumnHeader.GetCell(1, 1).Value = "PM";
calendarTemplate1.ColumnHeader.GetCell(1, 1).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter;
calendarTemplate1.Content.CellStyleName = "defaultStyle";
calendarTemplate1.Content.GetCell(0, 0).DateFormat = "d日";
calendarTemplate1.Content.GetCell(0, 0).DateFormatType = GrapeCity.Win.CalendarGrid.CalendarDateFormatType.DotNet;
calendarTemplate1.Content.GetCell(0, 0).RowSpan = 1;
calendarTemplate1.Content.GetCell(0, 0).ColumnSpan = 2;
return calendarTemplate1;
}
Private Function CreateTemplate() As CalendarTemplate
Dim calendarTemplate1 As New GrapeCity.Win.CalendarGrid.CalendarTemplate()
Dim calendarHeaderCellType1 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
Dim calendarHeaderCellType2 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
Dim calendarHeaderCellType3 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
Dim calendarHeaderCellType4 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
calendarTemplate1.ColumnCount = 2
calendarTemplate1.ColumnHeaderRowCount = 2
'The first column is not allowed to resizing.
calendarTemplate1.ColumnHeader.Columns(0).AllowResize = False
calendarTemplate1.RowCount = 2
calendarTemplate1.RowHeaderColumnCount = 0
calendarTemplate1.ColumnHeader.CellStyleName = "defaultStyle"
calendarTemplate1.ColumnHeader.GetCell(0, 0).CellType = calendarHeaderCellType1
calendarTemplate1.ColumnHeader.GetCell(0, 0).DateFormat = "Resize Me"
calendarTemplate1.ColumnHeader.GetCell(0, 0).RowSpan = 1
calendarTemplate1.ColumnHeader.GetCell(0, 0).ColumnSpan = 2
calendarTemplate1.ColumnHeader.GetCell(0, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter
calendarTemplate1.ColumnHeader.GetCell(0, 1).CellType = calendarHeaderCellType2
calendarTemplate1.ColumnHeader.GetCell(1, 0).CellType = calendarHeaderCellType3
calendarTemplate1.ColumnHeader.GetCell(1, 0).Value = "AM"
calendarTemplate1.ColumnHeader.GetCell(1, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter
calendarTemplate1.ColumnHeader.GetCell(1, 1).CellType = calendarHeaderCellType4
calendarTemplate1.ColumnHeader.GetCell(1, 1).Value = "PM"
calendarTemplate1.ColumnHeader.GetCell(1, 1).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter
calendarTemplate1.Content.CellStyleName = "defaultStyle"
calendarTemplate1.Content.GetCell(0, 0).DateFormat = "d日"
calendarTemplate1.Content.GetCell(0, 0).DateFormatType = GrapeCity.Win.CalendarGrid.CalendarDateFormatType.DotNet
calendarTemplate1.Content.GetCell(0, 0).RowSpan = 1
calendarTemplate1.Content.GetCell(0, 0).ColumnSpan = 2
Return calendarTemplate1
End Function