Spread ASP.NET 15
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / SheetViewCollection Class / Contains Method
Example


In This Topic
    Contains Method (SheetViewCollection)
    In This Topic
    Specifies whether a specified sheet is in the collection.
    Overload List
    OverloadDescription
    Specifies whether a specified sheet is in the collection.  
    Specifies whether a specified sheet is in the collection.  
    Example
    This example returns whether the collection contains the specified sheet.
    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();
    bool b;
    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);
    
    b = FpSpread1.Sheets.Contains(sv2);
    Response.Write("Is the specified sheet in the collection is " + b.ToString());
    
    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 b As Boolean
    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)
    
    b = FpSpread1.Sheets.Contains(sv2)
    Response.Write("Is the specified sheet in the collection is " & b.ToString())
    See Also