# Creating Alternating Rows

Spread for ASP.NET allows you to create alternating rows such that they have different appearance. Learn more about the alternating rows in documentation.

## Content

You might want to set up your sheet so that alternating rows have different appearance. For example, in a ledger, alternating rows often have a green background. In Spread, you can set up multiple alternating row appearances, which are applied in sequence, starting with the first row. The following image displays alternating row colors:
![Alternating Rows](https://cdn.mescius.io/document-site-files/images/346c9178-0ed8-4fb9-908b-1565b22fb408/artwork/altrow.png)
Set up the alternating rows using an index into the alternating row appearances. It might help to think of the default row appearance as the first alternating row style (or style zero, because the index is zero-based). Set the other alternating row appearances to subsequent indexes. Refer to the [AlternatingRow](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRow.html) class.

## Using a Shortcut

1. Set the [Count](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRows.Count.html) property for the [AlternatingRows](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRows.html) shortcut object.
2. Set the various appearance and other properties of the [AlternatingRows](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRows.html) shortcut object, such as the [BackColor](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRow.BackColor.html) and [ForeColor](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRow.ForeColor.html) properties.
3. Create additional alternating row appearances by setting properties for additional [AlternatingRows](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.AlternatingRows.html) shortcut objects, increasing the index for each appearance you create.

## Example

This example code creates a sheet that has three different appearance settings for rows. The first row uses the default appearance. The second row has a light blue background with dark blue text, and the third row has an orange background with dark red text. This pattern repeats for all subsequent rows.

```csharp
FpSpread1.Sheets[0].AlternatingRows.Count = 3;
FpSpread1.Sheets[0].AlternatingRows[1].BackColor = Color.LightBlue;
FpSpread1.Sheets[0].AlternatingRows[1].ForeColor = Color.DarkBlue;
FpSpread1.Sheets[0].AlternatingRows[2].BackColor = Color.Orange;
FpSpread1.Sheets[0].AlternatingRows[2].ForeColor = Color.DarkRed;
```

```vbnet
FpSpread1.Sheets(0).AlternatingRows.Count = 3
FpSpread1.Sheets(0).AlternatingRows(1).BackColor = Color.LightBlue
FpSpread1.Sheets(0).AlternatingRows(1).ForeColor = Color.DarkBlue
FpSpread1.Sheets(0).AlternatingRows(2).BackColor = Color.Orange
FpSpread1.Sheets(0).AlternatingRows(2).ForeColor = Color.DarkRed
```

## Using the Spread Designer

1. From the **Settings** menu, select the **AlternatingRow** editor icon located under the **Other Settings** section.
2. In the **AlternatingRow** editor, add the number of alternating row objects you want to provide, using the **AltRow** section.
3. Select the alternating row object for which you want to set properties from the list of row objects.
4. Set the properties for the alternating row object in the list of properties.
5. Repeat steps 3 and 4 for each alternating row object you want to customize.
6. Click **OK** to close the editor.
7. Click **Apply and Exit** to close the Spread Designer.