テンプレートの列ヘッダを操作するには、Template.ColumnHeadersプロパティを通してColumnHeaderSectionCollectionクラスのオブジェクトを操作します。
コーディングで列ヘッダを追加するには、ColumnHeaderSectionクラスのインスタンスを作成し、ColumnHeaderSectionCollection.Addメソッドを使用します。
Imports GrapeCity.Win.MultiRow
Dim Template1 As Template = New Template()
Dim ColumnHeaderSection1 As ColumnHeaderSection = new ColumnHeaderSection()
Dim ColumnHeaderCell1 As ColumnHeaderCell = New ColumnHeaderCell()
ColumnHeaderCell1.Location = New Point(0, 0)
ColumnHeaderCell1.Value = "列1"
ColumnHeaderSection1.Cells.Add(ColumnHeaderCell1)
ColumnHeaderSection1.Height = ColumnHeaderCell1.Height
Dim TextBoxCell1 As TextBoxCell = New TextBoxCell()
TextBoxCell1.Name = "TextBoxCell1"
TextBoxCell1.Location = New Point(0, 0)
Template1.Width = TextBoxCell1.Width
Template1.Row.Cells.Add(TextBoxCell1)
Template1.Row.Height = TextBoxCell1.Height
Template1.ColumnHeaders.Add(ColumnHeaderSection1)
GcMultiRow1.Template = Template1
GcMultiRow1.RowCount = 10
using GrapeCity.Win.MultiRow;
Template template = new Template();
ColumnHeaderSection columnHeaderSection1 = new ColumnHeaderSection();
ColumnHeaderCell columnHeaderCell1 = new ColumnHeaderCell();
columnHeaderCell1.Location = new Point(0, 0);
columnHeaderCell1.Value = "列1";
columnHeaderSection1.Cells.Add(columnHeaderCell1);
columnHeaderSection1.Height = columnHeaderCell1.Height;
TextBoxCell textBoxCell1 = new TextBoxCell();
textBoxCell1.Name = "textBoxCell1";
textBoxCell1.Location = new Point(0, 0);
template.Width = textBoxCell1.Width;
template.Row.Cells.Add(textBoxCell1);
template.Row.Height = textBoxCell1.Height;
template.ColumnHeaders.Add(columnHeaderSection1);
gcMultiRow1.Template = template;
gcMultiRow1.RowCount = 10;