[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.RangeTemplateCellType

RangeTemplateCellType Class

Provides a range template from a referenced worksheet that can be applied to a cell.

The range template cell type renders the cell with the same layout and styles as the template range, while filling data independently. If rowCount or columnCount is less than or equal to 0, the worksheet's used range is used as the template scope.

This cell type is useful when you want to display data in a consistent structure across multiple cells without repeatedly configuring the same styles. Data can be loaded into the range template from a data source using binding paths.

Inheritance
RangeTemplateCellType
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public class RangeTemplateCellType : BaseCellType
Public Class RangeTemplateCellType
    Inherits BaseCellType
Examples
IWorksheet templateSheet = workbook.Worksheets.Add();
templateSheet.Range["A1"].Value = "Name";
templateSheet.Range["A2"].Value = "Score";
templateSheet.Range["B1"].BindingPath = "name";
templateSheet.Range["B2"].BindingPath = "score";

RangeTemplateCellType cellType = new RangeTemplateCellType(templateSheet);
worksheet.Range["A1:A3"].CellType = cellType;

Constructors

Name Description
RangeTemplateCellType(IRange)

Initializes a new instance of the RangeTemplateCellType class with a template range.

RangeTemplateCellType(IWorksheet, int, int, int, int)

Initializes a new instance of the RangeTemplateCellType class with a worksheet and template range information.

If rowCount or columnCount is less than or equal to 0, the worksheet's used range is used as the template scope.

Methods

Name Description
UpdateTemplate(IRange)

Updates the template range used by this cell type.