GrapeCity MultiRow Windows Forms Documentation
Adding Cells

Use the Template.Row.Add method to add cells to the template using code.

Using Code

The following sample code adds a ColumnHeaderCell to the column header and a TextBoxCell to rows in the template.

[VB]

Imports GrapeCity.Win.MultiRow

Dim template As Template = New Template()
Dim columnHeaderSection1 As ColumnHeaderSection = New ColumnHeaderSection()
Dim columnHeaderCell1 As ColumnHeaderCell = New ColumnHeaderCell()

Dim textBoxCell1 As TextBoxCell = New TextBoxCell()
template.Width = textBoxCell1.Size.Width
template.Row.Cells.Add(textBoxCell1)
template.Row.Height = textBoxCell1.Size.Height

columnHeaderSection1.Cells.Add(columnHeaderCell1)
columnHeaderSection1.Height = columnHeaderCell1.Size.Height
template.ColumnHeaders.Add(columnHeaderSection1)

GcMultiRow1.Template = template
GcMultiRow1.RowCount = 10

[CS]

using GrapeCity.Win.MultiRow; 

Template template = new Template();
ColumnHeaderSection columnHeaderSection1 = new ColumnHeaderSection();
ColumnHeaderCell columnHeaderCell1 = new ColumnHeaderCell();

TextBoxCell textBoxCell1 = new TextBoxCell();
template.Width = textBoxCell1.Size.Width;
template.Row.Cells.Add(textBoxCell1);
template.Row.Height = textBoxCell1.Size.Height;

columnHeaderSection1.Cells.Add(columnHeaderCell1);
columnHeaderSection1.Height = columnHeaderCell1.Size.Height;
template.ColumnHeaders.Add(columnHeaderSection1);

gcMultiRow1.Template = template; 
gcMultiRow1.RowCount = 10;
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options