PowerTools CalendarGrid for Windows Forms 1.0J
セル型を配置する(テンプレート)

テンプレートにセル型を配置するには、次の手順が必要です。

  1. テンプレートに配置するセル型のインスタンスを作成する。
  2. CalendarCell.CellTypeプロパティに手順1で作成したセル型を設定する。

次のコードでは、コンテンツセクションの1行1列目にCheckBox型セル、3行1列目にButton型セルを配置します。

Imports GrapeCity.Win.CalendarGrid

Dim template As New CalendarTemplate()
template.RowHeaderColumnCount = 1
template.ColumnCount = 1
template.ColumnHeaderRowCount = 1
template.RowCount = 3
template.RowHeader.Columns(0).Width = 30

' CheckBox型セルを作成します。
Dim checkBoxCellType As New CalendarCheckBoxCellType()
checkBoxCellType.Text = "確認済"

' Button型セルを作成します。
Dim buttonCellType As New CalendarButtonCellType()

' テンプレートにセル型を配置して、値を設定します。
template.Content.Rows(0).Cells(0).CellType = checkBoxCellType.Clone()
template.Content.Rows(0).Cells(0).Value = True
template.Content.Rows(2).Cells(0).CellType = buttonCellType.Clone()
template.Content.Rows(2).Cells(0).Value = "確定"

GcCalendarGrid1.Template = template
using GrapeCity.Win.CalendarGrid;

CalendarTemplate template = new CalendarTemplate();
template.RowHeaderColumnCount = 1;
template.ColumnCount = 1;
template.ColumnHeaderRowCount = 1;
template.RowCount = 3;
template.RowHeader.Columns[0].Width = 30;

// CheckBox型セルを作成します。
CalendarCheckBoxCellType checkBoxCellType = new CalendarCheckBoxCellType();
checkBoxCellType.Text = "確認済";

// Button型セルを作成します。
CalendarButtonCellType buttonCellType = new CalendarButtonCellType();

// テンプレートにセル型を配置して、値を設定します。
template.Content.Rows[0].Cells[0].CellType = checkBoxCellType.Clone();
template.Content.Rows[0].Cells[0].Value = true;
template.Content.Rows[2].Cells[0].CellType = buttonCellType.Clone();
template.Content.Rows[2].Cells[0].Value = "確定";

gcCalendarGrid1.Template = template;

参照

 

 


© 2014 GrapeCity inc. All rights reserved.