MultiRow Windows Forms > Developer's Guide > Using MultiRow > Template > Adding Column Footers |
Use the ColumnFooterSectionCollection object in the Template.ColumnFooters property to work with column footers in the template.
Create an instance of the ColumnFooterSection class and use the ColumnFooterSectionCollection.Add method to add a column footer in code.
This example creates an instance of the ColumnFooterSection class and adds a footer.
Imports GrapeCity.Win.MultiRow Dim template As Template = New Template() Dim columnHeaderSection As ColumnHeaderSection = new ColumnHeaderSection() Dim columnHeaderCell1 As ColumnHeaderCell = New ColumnHeaderCell() columnHeaderCell1.Location = New Point(0, 0) columnHeaderCell1.Value = "Col1" columnHeaderSection.Cells.Add(columnHeaderCell1) columnHeaderSection.Height = columnHeaderCell1.Height Dim textBoxCell1 As TextBoxCell = New TextBoxCell() textBoxCell1.Name = "textBoxCell1" textBoxCell1.Location = New Point(0, 0) Dim columnFooterSection As ColumnFooterSection = new ColumnFooterSection() Dim headerCell1 As HeaderCell = new HeaderCell() headerCell1.Location = New Point(0, 0) headerCell1.Value = "Footer" columnFooterSection.Cells.Add(headerCell1) columnFooterSection.Height = headerCell1.Height template.Width = textBoxCell1.Width template.Row.Cells.Add(textBoxCell1) template.Row.Height = textBoxCell1.Height template.ColumnHeaders.Add(columnHeaderSection) template.ColumnFooters.Add(columnFooterSection) GcMultiRow1.Template = template GcMultiRow1.RowCount = 10 |
using GrapeCity.Win.MultiRow; Template template = new Template(); ColumnHeaderSection columnHeaderSection = new ColumnHeaderSection(); ColumnHeaderCell columnHeaderCell1 = new ColumnHeaderCell(); columnHeaderCell1.Location = new Point(0, 0); columnHeaderCell1.Value = "Col1"; columnHeaderSection.Cells.Add(columnHeaderCell1); columnHeaderSection.Height = columnHeaderCell1.Height; TextBoxCell textBoxCell1 = new TextBoxCell(); textBoxCell1.Name = "textBoxCell1"; textBoxCell1.Location = new Point(0, 0); ColumnFooterSection columnFooterSection = new ColumnFooterSection(); HeaderCell headerCell1 = new HeaderCell(); headerCell1.Location = new Point(0, 0); headerCell1.Value = "Footer"; columnFooterSection.Cells.Add(headerCell1); columnFooterSection.Height = headerCell1.Height; template.Width = textBoxCell1.Width; template.Row.Cells.Add(textBoxCell1); template.Row.Height = textBoxCell1.Height; template.ColumnHeaders.Add(columnHeaderSection); template.ColumnFooters.Add(columnFooterSection); gcMultiRow1.Template = template; gcMultiRow1.RowCount = 10; |
Use ColumnFooterSectionCollection.Remove or RemoveAt methods to delete the column footer.