GrapeCity CalendarGrid for Windows Forms 2.0J
並びの方向を設定する

複数列のスタイルのカレンダーでは、既定では左から右に向かって水平方向に日を並べます。
CalendarMonthMultiColumnView.Orientationプロパティを使うと、上から下に向かって垂直方向に日を並べることができます。

Imports GrapeCity.Win.CalendarGrid

Dim template As New CalendarTemplate()
template.RowCount = 1
template.ColumnCount = 3
template.RowHeader.ColumnCount = 0

template.ColumnHeader.Columns(0).Width = 50
template.ColumnHeader.Rows(0).Cells(0).Value = "日付"
template.ColumnHeader.Columns(1).Width = 50
template.ColumnHeader.Rows(0).Cells(1).Value = "曜日"
template.ColumnHeader.Rows(0).Cells(2).Value = "メモ"
template.Content.Rows(0).Cells(0).CellStyle.BackColor = Color.Azure
template.Content.Rows(0).Cells(0).DateFormat = "{MonthDay}"

template.Content.Rows(0).Cells(0).CellStyleName = "defaultStyle"
template.Content.Rows(0).Cells(1).CellStyle.BackColor = Color.Azure
template.Content.Rows(0).Cells(1).DateFormat = "{DayOfWeek}"
template.Content.Rows(0).Cells(1).CellStyleName = "defaultStyle"
GcCalendarGrid1.Template = template

Dim monthMultiColumnView As New CalendarMonthMultiColumnView()
monthMultiColumnView.Orientation = Orientation.Vertical
monthMultiColumnView.ColumnBreaks = New Integer() { 10, 20 }
GcCalendarGrid1.CalendarView = monthMultiColumnView
using GrapeCity.Win.CalendarGrid;

var template = new CalendarTemplate();
template.RowCount = 1;
template.ColumnCount = 3;
template.RowHeader.ColumnCount = 0;

template.ColumnHeader.Columns[0].Width = 50;
template.ColumnHeader.Rows[0].Cells[0].Value = "日付";
template.ColumnHeader.Columns[1].Width = 50;
template.ColumnHeader.Rows[0].Cells[1].Value = "曜日";
template.ColumnHeader.Rows[0].Cells[2].Value = "メモ";

template.Content.Rows[0].Cells[0].CellStyle.BackColor = Color.Azure;
template.Content.Rows[0].Cells[0].DateFormat = "{MonthDay}";
template.Content.Rows[0].Cells[0].CellStyleName = "defaultStyle";
template.Content.Rows[0].Cells[1].CellStyle.BackColor = Color.Azure;
template.Content.Rows[0].Cells[1].DateFormat = "{DayOfWeek}";
template.Content.Rows[0].Cells[1].CellStyleName = "defaultStyle";
gcCalendarGrid1.Template = template;

var monthMultiColumnView = new CalendarMonthMultiColumnView();
monthMultiColumnView.Orientation = Orientation.Vertical;
monthMultiColumnView.ColumnBreaks = new int[] { 10, 20 };
gcCalendarGrid1.CalendarView = monthMultiColumnView;

参照

 

 


© 2008 GrapeCity inc. All rights reserved.