private void UseCustomTemplate2()
{
CalendarListView listView = new CalendarListView();
listView.DayCount = 100;
this.gcCalendarGrid1.CalendarView = listView;
CalendarTemplate template = new CalendarTemplate(4, 1, 2, 2);
template.ColumnHeader.CellStyle.Alignment = CalendarGridContentAlignment.MiddleCenter;
template.ColumnHeader[0, 0].DateFormat = CalendarDateFormats.Month;
template.ColumnHeader[0, 0].AutoMergeMode = AutoMergeMode.Horizontal;
template.ColumnHeader[0, 0].AllowContentFloat = true;
template.ColumnHeader[1, 0].DateFormat = CalendarDateFormats.Day;
template.RowHeader.CellStyle.Alignment = CalendarGridContentAlignment.MiddleCenter;
template.RowHeader.Columns[0].Width = 30;
template.RowHeader.Columns[1].Width = 30;
template.Content.Columns[0].Width = 30;
template.RowHeader[0, 0].Value = "Active";
template.RowHeader[0, 0].ColumnSpan = 2;
CalendarCheckBoxCellType checkBoxCellType = new CalendarCheckBoxCellType();
checkBoxCellType.CheckAlign = ContentAlignment.MiddleCenter;
template.Content[0, 0].CellType = checkBoxCellType;
template.Content.Rows[0].Height = 30;
template.RowHeader[1, 0].Value = "Content";
template.RowHeader[1, 0].RowSpan = 2;
template.RowHeader[1, 0].CellStyle.TextVertical = CalendarGridTriState.True;
template.RowHeader[1, 0].CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True;
template.RowHeader[1, 1].Value = "AM";
template.RowHeader[2, 1].Value = "PM";
template.Content[1, 0].CellStyle.Alignment = CalendarGridContentAlignment.TopCenter;
template.Content[1, 0].CellStyle.TextVertical = CalendarGridTriState.True;
template.Content[1, 0].CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True;
template.Content.Rows[1].Height = 150;
template.Content[2, 0].CellStyle.Alignment = CalendarGridContentAlignment.TopCenter;
template.Content[2, 0].CellStyle.TextVertical = CalendarGridTriState.True;
template.Content[2, 0].CellStyle.UseCompatibleTextRendering = CalendarGridTriState.True;
template.Content.Rows[2].Height = 150;
template.RowHeader[3, 0].Value = "More";
template.RowHeader[3, 0].ColumnSpan = 2;
template.Content[3, 0].Value = "...";
template.Content[3, 0].CellType = new CalendarButtonCellType();
template.Content[3, 0].CellStyle.Alignment = CalendarGridContentAlignment.MiddleCenter;
template.Content.Rows[0].Height = 30;
this.gcCalendarGrid1.Template = template;
}
Private Sub UseCustomTemplate2()
Dim listView As New CalendarListView()
listView.DayCount = 100
Me.gcCalendarGrid1.CalendarView = listView
Dim template As New CalendarTemplate(4, 1, 2, 2)
template.ColumnHeader.CellStyle.Alignment = CalendarGridContentAlignment.MiddleCenter
template.ColumnHeader(0, 0).DateFormat = CalendarDateFormats.Month
template.ColumnHeader(0, 0).AutoMergeMode = AutoMergeMode.Horizontal
template.ColumnHeader(0, 0).AllowContentFloat = True
template.ColumnHeader(1, 0).DateFormat = CalendarDateFormats.Day
template.RowHeader.CellStyle.Alignment = CalendarGridContentAlignment.MiddleCenter
template.RowHeader.Columns(0).Width = 30
template.RowHeader.Columns(1).Width = 30
template.Content.Columns(0).Width = 30
template.RowHeader(0, 0).Value = "Active"
template.RowHeader(0, 0).ColumnSpan = 2
Dim checkBoxCellType As New CalendarCheckBoxCellType()
checkBoxCellType.CheckAlign = ContentAlignment.MiddleCenter
template.Content(0, 0).CellType = checkBoxCellType
template.Content.Rows(0).Height = 30
template.RowHeader(1, 0).Value = "Content"
template.RowHeader(1, 0).RowSpan = 2
template.RowHeader(1, 0).CellStyle.TextVertical = CalendarGridTriState.[True]
template.RowHeader(1, 0).CellStyle.UseCompatibleTextRendering = CalendarGridTriState.[True]
template.RowHeader(1, 1).Value = "AM"
template.RowHeader(2, 1).Value = "PM"
template.Content(1, 0).CellStyle.Alignment = CalendarGridContentAlignment.TopCenter
template.Content(1, 0).CellStyle.TextVertical = CalendarGridTriState.[True]
template.Content(1, 0).CellStyle.UseCompatibleTextRendering = CalendarGridTriState.[True]
template.Content.Rows(1).Height = 150
template.Content(2, 0).CellStyle.Alignment = CalendarGridContentAlignment.TopCenter
template.Content(2, 0).CellStyle.TextVertical = CalendarGridTriState.[True]
template.Content(2, 0).CellStyle.UseCompatibleTextRendering = CalendarGridTriState.[True]
template.Content.Rows(2).Height = 150
template.RowHeader(3, 0).Value = "More"
template.RowHeader(3, 0).ColumnSpan = 2
template.Content(3, 0).Value = "..."
template.Content(3, 0).CellType = New CalendarButtonCellType()
template.Content(3, 0).CellStyle.Alignment = CalendarGridContentAlignment.MiddleCenter
template.Content.Rows(0).Height = 30
Me.gcCalendarGrid1.Template = template
End Sub