Spread for ASP.NET 11 Product Documentation
Item Property (AlternatingRows)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > AlternatingRows Class : Item Property
Index of the alternating row in the collection
Gets a new alternating row for the specified alternating row.
Syntax
'Declaration
 
Public ReadOnly Default Property Item( _
   ByVal index As Integer _
) As AlternatingRow
'Usage
 
Dim instance As AlternatingRows
Dim index As Integer
Dim value As AlternatingRow
 
value = instance.Item(index)
public AlternatingRow this[ 
   int index
]; {get;}

Parameters

index
Index of the alternating row in the collection

Property Value

AlternatingRow object containing the specified alternating row style
Exceptions
ExceptionDescription
Specified alternating row index is less than 0 or greater than or equal to the alternating row count
Remarks
The index is the zero-based index number of the AlternatingRow object in the collection. The index of the first row is 0. Subsequent indices are 1 for the second row, 2 for the third row, and so on.
Example
This example sets up three alternating rows and uses the Item property and its index to set change the background color of the rows. Note: In C#, the indexer is used instead of the Item property.
FpSpread1.Sheets[0].AlternatingRows.Count = 3;
FpSpread1.Sheets[0].AlternatingRows.Item[0].BackColor = Color.Red;
FpSpread1.Sheets[0].AlternatingRows.Item[1].BackColor = Color.Blue;
FpSpread1.Sheets[0].AlternatingRows.Item[2].BackColor = Color.Green;
FpSpread1.Sheets(0).AlternatingRows.Count = 3
FpSpread1.Sheets(0).AlternatingRows.Parent(0).BackColor = Color.Red
FpSpread1.Sheets(0).AlternatingRows.Parent(1).BackColor = Color.Blue
FpSpread1.Sheets(0).AlternatingRows.Parent(2).BackColor = Color.Green
See Also

Reference

AlternatingRows Class
AlternatingRows Members
Index Property