Spread for ASP.NET 7.0 Product Documentation
IndexOf Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetViewCollection Class : IndexOf Method


sheetView
Sheet whose index to return

Glossary Item Box

Gets the index of a specified sheet in the collection.

Syntax

Visual Basic (Declaration) 
Public Function IndexOf( _
   ByVal sheetView As SheetView _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As SheetViewCollection
Dim sheetView As SheetView
Dim value As Integer
 
value = instance.IndexOf(sheetView)
C# 
public int IndexOf( 
   SheetView sheetView
)

Parameters

sheetView
Sheet whose index to return

Return Value

Integer index of the sheet in the collection

Example

This example returns the index of the specified sheet.
C#Copy Code
System.Collections.ArrayList coll = New System.Collections.ArrayList(2);
FarPoint.Web.Spread.SheetView sv2 = New FarPoint.Web.Spread.SheetView();
FarPoint.Web.Spread.SheetView sv3 = New FarPoint.Web.Spread.SheetView();
int i;
sv2.GridLineColor = Color.Red;
sv2.GridLines = GridLines.Vertical;
sv3.GridLineColor = Color.Yellow;
sv3.GridLines = GridLines.Horizontal;
coll.Add(sv2);
coll.Add(sv3);
FpSpread1.Sheets.Clear();
FpSpread1.Sheets.AddRange(coll);

i = FpSpread1.Sheets.IndexOf(sv3);
Response.Write("The index of the specified sheet is " + i.ToString());
Visual BasicCopy Code
Dim coll As New System.Collections.ArrayList(2)
Dim sv2 As New FarPoint.Web.Spread.SheetView
Dim sv3 As New FarPoint.Web.Spread.SheetView
Dim i As Integer
sv2.GridLineColor = Color.Red
sv2.GridLines = GridLines.Vertical
sv3.GridLineColor = Color.Yellow
sv3.GridLines = GridLines.Horizontal
coll.Add(sv2)
coll.Add(sv3)
FpSpread1.Sheets.Clear()
FpSpread1.Sheets.AddRange(coll)

i = FpSpread1.Sheets.IndexOf(sv3)
Response.Write("The index of the specified sheet is " & i.ToString())

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

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