# Displaying Grid Lines on the Sheet

Use Spread for ASP.NET to display grid lines on the sheet that distinguish rows or columns (or both). Learn how you can set the colors for it in documentation.

## Content

You can display grid lines on the sheet that distinguish rows or columns (or both). You can set the grid lines to display using the [GridLines](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.GridLines.html) property for the sheet (which uses the settings of the **GridLines** enumeration in the underlying Microsoft .NET framework).

* To show only the grid lines for the rows (horizontal lines), set the property to GridLines.Horizontal.
* To show only the grid lines for the columns (vertical lines), set the property to GridLines.Vertical.
* To show the grid lines for both the rows and the columns (both the vertical and horizontal lines), set the property to GridLines.Both.
* To turn off (or hide) the grid lines, set the property to GridLines.None.

You can set the color of the grid lines. In the following figure, where both the horizontal and vertical lines are displayed, the grid lines are red.
![Sheet with red gridlines](https://cdn.mescius.io/document-site-files/images/346c9178-0ed8-4fb9-908b-1565b22fb408/artwork/sheetgridcolor.png)
You can also set the grid lines and the grid lines color by defining these properties in the [SheetSkin](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetSkin.html) class and then applying the skin to the sheet. For more information creating and applying skins, refer to [Applying a Skin to a Sheet](/spreadnet/docs/latest/online-asp/overview/spweb-devguide/spweb-appearSet/spweb-appearSheet/spweb-SheetSkinApply) and [Creating a Skin for Sheets](/spreadnet/docs/latest/online-asp/overview/spweb-devguide/spweb-appearSet/spweb-appearSheet/spweb-SheetSkinCreate).
To set borders around individual cells, refer to [Customizing Cell Borders](/spreadnet/docs/latest/online-asp/overview/spweb-devguide/spweb-appearSet/spweb-appearCell/spweb-cellborder).

## Using the Properties Window

1. At design time, in the **Properties** window, select the **Sheets** property for the FpSpread component.
2. Click the button to display the **SheetView Collection Editor**.
3. In the **Members** list, select the sheet for which you want to set the grid line color.
4. Select the **GridLineColor** property in the property list, and then click the drop-down button to display the color picker.
5. Select a color in the color picker.
6. Click **OK** to close the editor.

## Using a Shortcut

Set the [GridLines](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.GridLines.html) and [GridLineColor](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.GridLineColor.html) properties of the [FpSpread](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.html) component [Sheets](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.Sheets.html) shortcut.

## Example

This example code sets the grid line color to red and displays the row grid lines.

```csharp
// Set the grid line color to red.
FpSpread1.Sheets[0].GridLineColor = System.Drawing.Color.Red;
FpSpread1.Sheets[0].GridLines = GridLines.Horizontal;
```

```vbnet
' Set the grid line color to red.
FpSpread1.Sheets(0).GridLineColor = System.Drawing.Color.Red
FpSpread1.Sheets(0).GridLines = GridLines.Horizontal
```

## Using the Spread Designer

1. Select the **Settings** menu.
2. From the sheets displayed at the bottom, select the sheet for which you want to set the grid line color.
3. Select the **GridLines** icon in the **Sheet Setting** section.
4. Set the color or any other grid properties.
5. Click **OK** to close the dialog.
6. Click **Apply and Exit** to close the Spread Designer.