Spread for ASP.NET 7.0 Product Documentation
Remove Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > WorksheetTemplate Class : Remove Method


index
Layout column index at which to start
count
Number of layout columns to remove

Glossary Item Box

Removes a column or range of layout columns.

Syntax

Visual Basic (Declaration) 
Public Sub Remove( _
   ByVal index As Integer, _
   ByVal count As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As WorksheetTemplate
Dim index As Integer
Dim count As Integer
 
instance.Remove(index, count)
C# 
public void Remove( 
   int index,
   int count
)

Parameters

index
Layout column index at which to start
count
Number of layout columns to remove

Example

This example creates a template.
C#Copy Code
protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack) return;
            FarPoint.Web.Spread.Model.DefaultSheetDataModel dm = new FarPoint.Web.Spread.Model.DefaultSheetDataModel(10, 10);
            FpSpread1.ActiveSheetView.DataModel = dm; 
            FpSpread1.ActiveSheetView.LayoutMode = FarPoint.Web.Spread.SheetView.LayoutModeType.RowTemplateLayoutMode;
            FarPoint.Web.Spread.WorksheetTemplate template1;
            template1 = FpSpread1.Sheets[0].WorksheetTemplate;
            template1.ColumnCount = 3;
            template1.ColumnHeaderTemplate.RowCount = 2;
            template1.RowTemplate.RowCount = 2;
            template1.LayoutColumns[1].Width = 250;
            //Set row template's layout 
            template1.RowTemplate.LayoutCells[1, 1].ColumnSpan = 2;
            //set column header template's layout
            template1.ColumnHeaderTemplate.LayoutCells[0, 0].RowSpan = 2;
            template1.ColumnHeaderTemplate.LayoutCells[1, 1].ColumnSpan = 2;
            //Add or Remove a template column
            //template1.Add(0, 1);
            //template1.Remove(0, 1);
            template1.LayoutDataModel = dm;
        }
VB.NETCopy Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load
            If (IsPostBack) Then
                Return
            End If

            Dim dm As New FarPoint.Web.Spread.Model.DefaultSheetDataModel(10, 10)
            FpSpread1.ActiveSheetView.DataModel = dm
            FpSpread1.ActiveSheetView.LayoutMode = FarPoint.Web.Spread.SheetView.LayoutModeType.RowTemplateLayoutMode
            Dim template1 As FarPoint.Web.Spread.WorksheetTemplate
            template1 = FpSpread1.Sheets(0).WorksheetTemplate
            template1.ColumnCount = 3
            template1.ColumnHeaderTemplate.RowCount = 2
            template1.RowTemplate.RowCount = 2
            template1.LayoutColumns(1).Width = 250
            'Set row template's layout 
            template1.RowTemplate.LayoutCells(1, 1).ColumnSpan = 2
            'set column header template's layout
            template1.ColumnHeaderTemplate.LayoutCells(0, 0).RowSpan = 2
            template1.ColumnHeaderTemplate.LayoutCells(1, 1).ColumnSpan = 2
            'Add or Remove a template column
            'template1.Add(0, 1);
            'template1.Remove(0, 1);
            template1.LayoutDataModel = dm
        End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.