# Setting up Preview Rows

Learn how to display a preview row in your record and customize its appearance with colors and formatting options. Set properties for the PreviewRowInfo class at design time and through code examples.

## Content

You can display a preview row to provide more information about a record. The preview row is displayed below the row for which it provides information. You can specify colors and other formatting for the preview row as well. The following figure shows preview rows with text (the rows without row header numbers):
![Preview Row](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/previewrow.png)
Set the [Visible](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.Visible.html) property of the [PreviewRowInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.html) class to true to see the preview row. Use the [ColumnIndex](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.ColumnIndex.html) property of the [PreviewRowInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.html) class to specify which column’s text you want to see in the preview row. If the cell text is null, then the preview row content is null. You can also use the [PreviewRowFetch](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.PreviewRowFetch.html) event to specify the preview row text. You can set various properties for the [PreviewRowInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.html) class such as [BackColor](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.BackColor.html), [Border](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.Border.html), [Font](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.Font.html), and so on.
The column header or footer does not display a preview row. A child sheet in a hierarchy does not inherit the preview row settings from the parent sheet. If the sheet with the preview row has child sheets, the preview row is shown below the rows with plus symbols. If a row that has a preview row has spanned rows, the span is not displayed. The preview row is read-only (no keyboard or mouse events, focus, and/or selections).
The preview row is printed and exported to PDF when printing or printing to PDF. The height of the preview row can be increased to show all the preview row text. If there are multiple horizontal pages, the preview row content is displayed in the left-most page.
The API members involved in this feature include (see the [PreviewRowInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.html) class for a complete list):

* [PreviewRowInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.html) class
* [ColumnIndex](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.ColumnIndex.html) property
* [BackColor](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.BackColor.html) property
* [Visible](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PreviewRowInfo.Visible.html) property

## Using the Properties Window

1. At design time, in the **Properties** window, select the Sheet.
2. In the **SheetView Collection Editor** (**Misc** section), select the **PreviewRowInfo** option and set properties.

## Method to set

Set the **PreviewRowInfo** class properties for the sheet.

## **Example**

This example sets preview row properties.

```csharp
private void Form1_Load(object sender, EventArgs e)
{
FarPoint.Win.BevelBorder bord = new FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Red, Color.Blue);
fpSpread1.Sheets[0].Cells[0, 1, 10, 1].Text = "Preview Row";
fpSpread1.Sheets[0].PreviewRowInfo.Visible = true;
fpSpread1.Sheets[0].PreviewRowInfo.BackColor = Color.BurlyWood;
fpSpread1.Sheets[0].PreviewRowInfo.ForeColor = Color.Black;
fpSpread1.Sheets[0].PreviewRowInfo.Border = bord;
}

private void fpSpread1_PreviewRowFetch(object sender, FarPoint.Win.Spread.PreviewRowFetchEventArgs e)
{
FarPoint.Win.Spread.SheetView sheetView = e.View.GetSheetView();
if (sheetView.SheetName == "Sheet1")
{
if (e.PreviewRowContent == string.Empty)
e.PreviewRowContent = "The preview row content is empty";
if ((e.Row + 1) % 2 == 0)
e.PreviewRowContent = string.Format("Preview Row Content is: {0}", e.PreviewRowContent);
}
}
```

```vbnet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim bord As New FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.DarkBlue, Color.Blue)
fpSpread1.Sheets(0).Cells(0, 1, 10, 1).Text = "Preview Row"
fpSpread1.Sheets(0).PreviewRowInfo.Visible = True
fpSpread1.Sheets(0).PreviewRowInfo.BackColor = Color.BurlyWood
fpSpread1.Sheets(0).PreviewRowInfo.ForeColor = Color.Black
fpSpread1.Sheets(0).PreviewRowInfo.Border = bord
End Sub

Private Sub fpSpread1_PreviewRowFetch(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.PreviewRowFetchEventArgs) Handles
fpSpread1.PreviewRowFetch
Dim sheetView As FarPoint.Win.Spread.SheetView
sheetView = e.View.GetSheetView()
If sheetView.SheetName = "Sheet1" Then
If (e.PreviewRowContent = String.Empty) Then
e.PreviewRowContent = "The preview row content is empty"
End If
If ((e.Row + 1) / 2 = 0) Then
e.PreviewRowContent = String.Format("Preview Row Content is: {0}", e.PreviewRowContent)
End If
End If
End Sub
```

## Using the Spread Designer

1. Select **Sheet** from the drop-down combo list located on the top right side of the Designer.
2. From the **Misc** section, select the **PreviewRowInfo** option to set properties.
3. From the **File** menu, select **Save and Exit** to save the changes.

## See Also

[Rows and Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol)
[Customizing the Number of Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolnumber)
[Adding a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcoladd)
[Removing a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolremove)
[Showing or Hiding a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolhide)
[Setting the Row Height or Column Width](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolsize)
[Setting Fixed (Frozen) Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcol-freeze)
[Moving Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcol-usermove)
[Creating Alternating Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolalt)
[Input Data in Rows or Columns](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcol-userentry)
[Rows or Columns That Have Data](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-rowcolnonempty)
[Adding a Tag to a Row or Column](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-rowcol/spwin-tags-rowcol)