Spread ASP.NET 16
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / DefaultSheetSpanModel Class / GetEnumerator Method / GetEnumerator(Int32,Int32,Int32,Int32) Method
Row index
Column index
Number of rows in span
Number of columns in span
Example


In This Topic
    GetEnumerator(Int32,Int32,Int32,Int32) Method
    In This Topic
    Gets an enumerator for iterating to the next cell span in the collection after the specified span.
    Syntax
    'Declaration
     
    Public Overloads Overrides Function GetEnumerator( _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal rowCount As Integer, _
       ByVal columnCount As Integer _
    ) As IEnumerator
    'Usage
     
    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)
    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.
    private void Page_Load(object sender,System.EventArgs e)
    {
    if(this.IsPostBack)return;
    
    FpSpread1.ActiveSheetView.ColumnCount=10;
    FpSpread1.ActiveSheetView.RowCount=10;
    FarPoint.Web.Spread.Model.DefaultSheetSpanModel model=(FarPoint.Web.Spread.Model.DefaultSheetSpanModel)FpSpread1.ActiveSheetView.SpanModel;
    model.Add(0,0,2,1);
    model.Add(0,2,3,2);
    System.Collections.IEnumerator ien=model.GetEnumerator(0,0,10,10);
    bool b1=ien.MoveNext();
    while(b1)
    {
    FarPoint.Web.Spread.Model.CellRange cr=(FarPoint.Web.Spread.Model.CellRange)ien.Current;
    ListBox1.Items.Add(cr.ToString());
    b1=ien.MoveNext();
    }
    }
    Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
    
    If(IsPostBack)Then Return
    
    Dim cr As FarPoint.Web.Spread.Model.CellRange
    Dim b1 As Boolean
    Dim ien As System.Collections.IEnumerator
    FpSpread1.ActiveSheetView.ColumnCount=10
    FpSpread1.ActiveSheetView.RowCount=10
    Dim model As FarPoint.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
    End While
    End Sub
    See Also