Spread ASP.NET 6.0 Product Documentation
Add Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetSpanModel Class : Add Method


row
Row index of cell at which to start span
column
Column index of cell at which to start span
rowCount
Number of rows in span
columnCount
Number of columns in span

Glossary Item Box

Adds a cell span to the collection.

Syntax

Visual Basic (Declaration) 
Public Overrides Function Add( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetSpanModel
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim value As Boolean
 
value = instance.Add(row, column, rowCount, columnCount)
C# 
public override bool Add( 
   int row,
   int column,
   int rowCount,
   int columnCount
)

Parameters

row
Row index of cell at which to start span
column
Column index of cell at which to start span
rowCount
Number of rows in span
columnCount
Number of columns in span

Return Value

true if the cell span added successfully; false otherwise

Example

This example adds a span to the ColumnHeaderSpanModel of the active sheet. In the click event of a button, the span is removed.
C#Copy Code
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;

boolb1;
FarPoint.Web.Spread.Model.CellRangerange;
FpSpread1.ActiveSheetView.ColumnCount=10;
FpSpread1.ActiveSheetView.RowCount=10;
FpSpread1.ActiveSheetView.ColumnHeader.RowCount=3;
FarPoint.Web.Spread.Model.ISheetSpanModelmodel=FpSpread1.ActiveSheetView.ColumnHeaderSpanModel;
model.Add(0,0,3,3);
range=model.Find(2,2);
b1=model.IsEmpty();
ListBox1.Items.Add(range.ToString());
ListBox1.Items.Add(Convert.ToString(model.GetEnumerator(0,0,3,3)));
ListBox1.Items.Add(Convert.ToString(b1));
}

privatevoidButton1_Click(objectsender,System.EventArgse)
{
FarPoint.Web.Spread.Model.ISheetSpanModelmodel=FpSpread1.ActiveSheetView.ColumnHeaderSpanModel;
model.Remove(0,0);
}
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(IsPostBack)ThenReturn

DimrangeAsFarPoint.Web.Spread.Model.CellRange
Dimb1AsBoolean
FpSpread1.ActiveSheetView.ColumnCount=10
FpSpread1.ActiveSheetView.RowCount=10
FpSpread1.ActiveSheetView.ColumnHeader.RowCount=3
DimmodelAsFarPoint.Web.Spread.Model.ISheetSpanModel=FpSpread1.ActiveSheetView.ColumnHeaderSpanModel
model.Add(0,0,3,3)
range=model.Find(2,2)
b1=model.IsEmpty()
ListBox1.Items.Add(range.ToString)
ListBox1.Items.Add(Convert.ToString(model.GetEnumerator(0,0,3,3)))
ListBox1.Items.Add(b1)
EndSub

PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
DimmodelAsFarPoint.Web.Spread.Model.ISheetSpanModel=FpSpread1.ActiveSheetView.ColumnHeaderSpanModel
model.Remove(0,0)
EndSub

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.