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


Glossary Item Box

Gets an enumerator that can iterate through the selections.

Syntax

Visual Basic (Declaration) 
Function GetEnumerator() As IEnumerator
Visual Basic (Usage)Copy Code
Dim instance As ISheetSelectionModel
Dim value As IEnumerator
 
value = instance.GetEnumerator()
C# 
IEnumerator GetEnumerator()

Return Value

IEnumerator object for enumerating to the next selection

Example

This example gets an enumerator that can iterate through the selections of cells.
C#Copy Code
FarPoint.Win.Spread.Model.ISheetSelectionModel sel;
IEnumerator se;
bool b;
FarPoint.Win.Spread.Model.CellRange cr;
sel = (FarPoint.Win.Spread.Model.ISheetSelectionModel)fpSpread1.ActiveSheet.Models.Selection;
sel.AddSelection(0, 0, 2, 2);
sel.AddSelection(3, 0, 3, 2);
se = sel.GetEnumerator();
b = se.MoveNext();
if (b == true)
{
cr = (FarPoint.Win.Spread.Model.CellRange)se.Current;
label1.Text = "First selection is Col - " + cr.Column + " Row - " + cr.Row + " Col2 - " + cr.ColumnCount + " Row2 - " + cr.RowCount;
}
Visual BasicCopy Code
Dim sel As FarPoint.Win.Spread.Model.ISheetSelectionModel
Dim se As IEnumerator
Dim b As Boolean
Dim cr As FarPoint.Win.Spread.Model.CellRange
sel = FpSpread1.ActiveSheet.Models.Selection
sel.AddSelection(0, 0, 2, 2)
sel.AddSelection(3, 0, 3, 2)
se = sel.GetEnumerator()
b = se.MoveNext()
If b = True Then
cr = se.Current()
Label1.Text = "First selection is Col - " & cr.Column & " Row - " & cr.Row & " Col2 - " & cr.ColumnCount & " Row2 - " & cr.RowCount
End If

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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