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.
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:
- SheetView.LayoutMode property
- SheetView.RowTemplate property
- RowTemplate class
- LayoutTemplate class
- LayoutCell class
- LayoutCells class
- LayoutColumn class
- LayoutColumns class
- LayoutRow class
- LayoutRows class
- SheetView.LayoutModeType enumeration
This feature has the following effects on other features:
- The row count of the column header and the column count of the row header are limited.
- This does not support changing the row height by the drag and drop operation, but it does support changing the column width by the drag and drop operation.
- The frozen columns feature is not supported, but the frozen rows feature is supported.The selection operation only supports the single selection policy of a sheet (SheetView object).
- The Axis model of Spread is limited: you cannot set row height or column width for the viewport, the row header, or the column header.
- The Span model of Spread is limited: you cannot set spans in the viewport, row header, column header, or column footer. You can get similar effects by spanning cells in the row template.
- This does not support the operation of moving a column by dragging and dropping.
Return to the row and column appearance overview at Customizing the Appearance of Rows and Columns.
Using Code
- Set the LayoutMode property for the sheet.
- 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
- Select the Settings menu.
- Select the Row Template icon under the Other Settings section.
- Set the various template properties.
- Click OK.
- Click Apply and Exit to close the Spread Designer.