Spread ASP.NET 6.0 Product Documentation
BackColor Property
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > AlternatingRow Class : BackColor Property


Glossary Item Box

Gets or sets the background color for cells in this alternating row.

Syntax

Visual Basic (Declaration) 
Public Property BackColor As Color
Visual Basic (Usage)Copy Code
Dim instance As AlternatingRow
Dim value As Color
 
instance.BackColor = value
 
value = instance.BackColor
C# 
public Color BackColor {get; set;}

Property Value

Color object containing the background color for cells in this alternating row

Remarks

The setting for this property can be overridden if a named style is assigned to the cell using the StyleName property, and that named style sets the background color.

Specify the text color for the cell by setting the ForeColor property.

Example

This example sets up a two-sheet component. The first sheet has three alternating rows, with the BackColor and ForeColor properties set for each of the rows.
C#Copy Code
FpSpread1.Sheets[0].AlternatingRows.Count = 3;
FpSpread1.Sheets[0].Name = "Sheet1";
FpSpread1.Sheets[1].Name = "Sheet2";
FpSpread1.Sheets[0].ColumnCount = 5;
FpSpread1.Sheets[1].ColumnCount = 5;
FpSpread1.Sheets[0].RowCount = 10;
FpSpread1.Sheets[1].RowCount = 10;
FpSpread1.Sheets[0].AlternatingRows[0].BackColor = Color.Red;
FpSpread1.Sheets[0].AlternatingRows[1].BackColor = Color.LightSkyBlue;
FpSpread1.Sheets[0].AlternatingRows[2].BackColor = Color.LightGreen;
FpSpread1.Sheets[1].AlternatingRows[0].BackColor = Color.Red;
FpSpread1.Sheets[1].AlternatingRows[1].BackColor = Color.LightSkyBlue;
FpSpread1.Sheets[0].AlternatingRows[1].ForeColor = Color.Red;
FpSpread1.Sheets[1].AlternatingRows[1].ForeColor = Color.OrangeRed;
Visual BasicCopy Code
FpSpread1.Sheets(0).AlternatingRows.Count = 3
FpSpread1.Sheets(0).Name = "Sheet1"
FpSpread1.Sheets(1).Name = "Sheet2"
FpSpread1.Sheets(0).ColumnCount = 5
FpSpread1.Sheets(1).ColumnCount = 5
FpSpread1.Sheets(0).RowCount = 10
FpSpread1.Sheets(1).RowCount = 10
FpSpread1.Sheets(0).AlternatingRows(0).BackColor = Color.Red
FpSpread1.Sheets(0).AlternatingRows(1).BackColor = Color.LightSkyBlue
FpSpread1.Sheets(0).AlternatingRows(2).BackColor = Color.LightGreen
FpSpread1.Sheets(1).AlternatingRows(0).BackColor = Color.Red
FpSpread1.Sheets(1).AlternatingRows(1).BackColor = Color.LightSkyBlue
FpSpread1.Sheets(0).AlternatingRows(1).ForeColor = Color.Red
FpSpread1.Sheets(1).AlternatingRows(1).ForeColor = Color.OrangeRed

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.