Spread Windows Forms 6.0 Product Documentation
GetEnumerator Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > ISheetSpanModel Interface : GetEnumerator Method


row
Row index
column
Column index
rowCount
Number of rows in cell span
columnCount
Number of columns in cell 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) 
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 ISheetSpanModel
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# 
IEnumerator GetEnumerator( 
   int row,
   int column,
   int rowCount,
   int columnCount
)

Parameters

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

Return Value

IEnumerator object for enumerating to the next span

Example

This example moves the models enumerator to the next instance.
C#Copy Code
FarPoint.Win.Spread.Model.ISheetSpanModel sp;
FarPoint.Win.Spread.Model.CellRange cr;
IEnumerator ie;
DialogResult dlg;
sp = (FarPoint.Win.Spread.Model.ISheetSpanModel)fpSpread1.ActiveSheet.Models.Span;
sp.Add(0, 0, 2, 2);
sp.Add(0, 3, 2, 2);
dlg = MessageBox.Show("Do you want to enumerate through the specified span??", "GetEnumerator", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     bool b;
     ie = sp.GetEnumerator(0, 3, 2, 2);
     b = ie.MoveNext();
     if (b == true)
     {
          cr = (FarPoint.Win.Spread.Model.CellRange)ie.Current;
          label1.Text = "The column is " + cr.Column.ToString() + " and the row is " + cr.Row;
     }
}
Visual BasicCopy Code
Dim sp As FarPoint.Win.Spread.Model.ISheetSpanModel
Dim cr As FarPoint.Win.Spread.Model.CellRange
Dim ie As IEnumerator
Dim dlg As DialogResult
sp = FpSpread1.ActiveSheet.Models.Span
sp.Add(0, 0, 2, 2)
sp.Add(0, 3, 2, 2)
dlg = MessageBox.Show("Do you want to enumerate through the specified span??", "GetEnumerator", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     Dim b As Boolean
     ie = sp.GetEnumerator(0, 3, 2, 2)
     b = ie.MoveNext()
     If b = True Then
          cr = ie.Current()
          Label1.Text = "The column is "  & cr.Column.ToString() & " and the row is " & cr.Row
     End If
End If

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

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