Spread for ASP.NET 11 Product Documentation
Count Property (SheetViewCollection)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetViewCollection Class : Count Property
Gets or sets the number of sheets in a collection.
Syntax
'Declaration
 
Public Shadows Property Count As Integer
'Usage
 
Dim instance As SheetViewCollection
Dim value As Integer
 
instance.Count = value
 
value = instance.Count
public new int Count {get; set;}

Property Value

Integer number of sheets in the collection
Remarks
This method counts the number of SheetView objects in the collection
Example
This example creates two sheets and adds them to the collection of the sheet so that the total number of sheets now equals three (which includes the one that is added by default and the two added to the collection). This is verified by returning the number of sheets in the collection to a list box.
System.Collections.ArrayList coll=new System.Collections.ArrayList(2);
FarPoint.Web.Spread.SheetView sv=new FarPoint.Web.Spread.SheetView();
FarPoint.Web.Spread.SheetView sv1=new FarPoint.Web.Spread.SheetView();
sv.GridLineColor=Color.Red;
sv.GridLines=GridLines.Vertical;
sv1.GridLineColor=Color.Yellow;
sv1.GridLines=GridLines.Horizontal;
coll.Add(sv);
coll.Add(sv1);
FpSpread1.Sheets.AddRange(coll);
ListBox1.Items.Add(Convert.ToString(FpSpread1.Sheets.Count));
Dim coll As New System.Collections.ArrayList(2)
Dim sv As New FarPoint.Web.Spread.SheetView()
Dim sv1 As New FarPoint.Web.Spread.SheetView()
sv.GridLineColor=Color.Red
sv.GridLines=GridLines.Vertical
sv1.GridLineColor=Color.Yellow
sv1.GridLines=GridLines.Horizontal
coll.Add(sv)
coll.Add(sv1)
FpSpread1.Sheets.AddRange(coll)
ListBox1.Items.Add(FpSpread1.Sheets.Count)
See Also

Reference

SheetViewCollection Class
SheetViewCollection Members
Add Method
AddRange Method
CopyTo Method