Spread ASP.NET 6.0 Product Documentation
Creating Row Templates (Multiple-Line Columns)
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Developer's Guide > Customizing the Appearance > Customizing the Appearance of Rows and Columns > Creating Row Templates (Multiple-Line Columns)

Glossary Item Box

You can create row templates, also called aggregation subtotals or multiple-line columns. You can display multiple lines within a column, such as to display address information together in one column that involves multiple fields of information.

Row Template (multiple-line columns) Example

In this figure, the ID and name information appear staggered in a single column and the street address and city information appear in the same column.

The parts of the API that are involved with this feature include:

This feature has the following effects on other features:

Return to the row and column appearance overview at Customizing the Appearance of Rows and Columns.

Using Code

  1. Set the LayoutMode property for the sheet.
  2. Set the various template properties such as the total number of columns and rows and any spans.

Example

This example assigns a layout mode for the column headers.

C# Copy Code
FpSpread1.ActiveSheetView.ColumnCount = 5;
FpSpread1.ActiveSheetView.LayoutMode = FarPoint.Web.Spread.SheetView.LayoutModeType.RowTemplateLayoutMode;
FpSpread1.ActiveSheetView.RowTemplate.ColumnCount = FpSpread1.ActiveSheetView.ColumnCount;
FpSpread1.ActiveSheetView.RowTemplate.RowCount = 3;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].ColumnSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].LayoutColumn.Width = 15;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].LayoutRow.Height = 15;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].DataIndex = 1;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].RowSpan = 3;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 1].DataIndex = 0;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 1].DataIndex = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 1].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 2].DataIndex = 3;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[2, 2].DataIndex = 4;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 3].DataIndex = 5;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 3].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[2, 3].DataIndex = 6;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 4].DataIndex = 9;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 4].DataIndex = 8;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[2, 4].DataIndex = 7;
VB Copy Code
FpSpread1.ActiveSheetView.ColumnCount = 5
FpSpread1.ActiveSheetView.LayoutMode = FarPoint.Web.Spread.SheetView.LayoutModeType.RowTemplateLayoutMode
FpSpread1.ActiveSheetView.RowTemplate.ColumnCount = FpSpread1.ActiveSheetView.ColumnCount
FpSpread1.ActiveSheetView.RowTemplate.RowCount = 3
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 0).ColumnSpan = 2
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 0).LayoutColumn.Width = 15
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 0).LayoutRow.Height = 15
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 0).DataIndex = 1
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 0).RowSpan = 3
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 1).DataIndex = 0
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(1, 1).DataIndex = 2
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(1, 1).RowSpan = 2
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 2).DataIndex = 3
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(2, 2).DataIndex = 4
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 3).DataIndex = 5
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 3).RowSpan = 2
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(2, 3).DataIndex = 6
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(0, 4).DataIndex = 9
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(1, 4).DataIndex = 8
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells(2, 4).DataIndex = 7

Using the Spread Designer

  1. Select the Settings menu.
  2. Select the Row Template icon under the Other Settings section.
  3. Set the various template properties.
  4. Click OK.
  5. Click Apply and Exit to close the Spread Designer.
© 2002-2012 GrapeCity, Inc. All Rights Reserved.