Spread ASP.NET 6.0 Product Documentation
GetEnumerator(Int32,Int32,Int32,Int32) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetSpanModel Class > GetEnumerator Method : GetEnumerator(Int32,Int32,Int32,Int32) Method


row
Row index
column
Column index
rowCount
Number of rows in span
columnCount
Number of columns in span

Glossary Item Box

Gets an enumerator for iterating to the next cell span in the collection after the specified span.

Syntax

Visual Basic (Declaration) 
Public Overloads Overrides Function GetEnumerator( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As IEnumerator
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 IEnumerator
 
value = instance.GetEnumerator(row, column, rowCount, columnCount)
C# 
public override IEnumerator GetEnumerator( 
   int row,
   int column,
   int rowCount,
   int columnCount
)

Parameters

row
Row index
column
Column index
rowCount
Number of rows in span
columnCount
Number of columns in span

Return Value

IEnumerator object for enumerating through the spans

Example

This example adds spans to the SpanModel of the active sheet. The GetEnumerator method returns those spans to a list box.
C#Copy Code
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;

FpSpread1.ActiveSheetView.ColumnCount=10;
FpSpread1.ActiveSheetView.RowCount=10;
FarPoint.Web.Spread.Model.DefaultSheetSpanModelmodel=(FarPoint.Web.Spread.Model.DefaultSheetSpanModel)FpSpread1.ActiveSheetView.SpanModel;
model.Add(0,0,2,1);
model.Add(0,2,3,2);
System.Collections.IEnumeratorien=model.GetEnumerator(0,0,10,10);
boolb1=ien.MoveNext();
while(b1)
{
FarPoint.Web.Spread.Model.CellRangecr=(FarPoint.Web.Spread.Model.CellRange)ien.Current;
ListBox1.Items.Add(cr.ToString());
b1=ien.MoveNext();
}
}
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(IsPostBack)ThenReturn

DimcrAsFarPoint.Web.Spread.Model.CellRange
Dimb1AsBoolean
DimienAsSystem.Collections.IEnumerator
FpSpread1.ActiveSheetView.ColumnCount=10
FpSpread1.ActiveSheetView.RowCount=10
DimmodelAsFarPoint.Web.Spread.Model.DefaultSheetSpanModel=FpSpread1.ActiveSheetView.SpanModel
model.Add(0,0,2,1)
model.Add(0,2,3,2)
ien=model.GetEnumerator(0,0,10,10)
b1=ien.MoveNext()
While(b1)
cr=CType(ien.Current,FarPoint.Web.Spread.Model.CellRange)
ListBox1.Items.Add(cr.ToString())
b1=ien.MoveNext
EndWhile

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.