# Customizing the Header Grid Lines

Discover the most efficient ways to set and customize grid lines for row and column headers in your spreadsheets, with detailed examples and step-by-step instructions for achieving the desired visual effects.

## Content

You can specify the grid lines for a header in ways similar to setting the grid lines for a sheet. For more information on grid lines, refer to [Displaying Grid Lines on a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-setappearance/spwin-appearcell/spwin-sheetgridcolor). In the following figure, the row header grid lines are three-dimensional with red hues and the column header grid lines are three-dimensional with blue hues.
![Example of Spread with Custom Header Grid Lines](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/gridlinesheaders.png)
You can specify the horizontal grid lines separately from the vertical grid lines. You can specify the column header grid lines separately from the row header grid lines.
In code, you can customize the grid lines in a header either in the row or column header classes or in the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class. You can use any of the following:

* [RowHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.html) class, [HorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.HorizontalGridLine.html) property
* [RowHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.html) class, [VerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.VerticalGridLine.html) property
* [ColumnHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.html) class [HorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.HorizontalGridLine.html) property
* [ColumnHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.html) class, [VerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.VerticalGridLine.html) property
* [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class [RowHeaderHorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.RowHeaderHorizontalGridLine.html) property
* [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class [RowHeaderVerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.RowHeaderVerticalGridLine.html) property
* [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class [ColumnHeaderHorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.ColumnHeaderHorizontalGridLine.html) property
* [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class [ColumnHeaderVerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.ColumnHeaderVerticalGridLine.html) property
* [GridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.GridLine.html) class

You can also set the headers to not show any grid lines, as shown in the following figure, by setting the grid line type to None.
![Headers with no grid lines](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/hdr-nogridlines.png)

## Using the Properties Window

1. At design time, in the **Properties** window, select the particular sheet from the selection drop-down list.
2. Another way to select the sheet is to select the Spread component, select the **Sheets** property, and click the button to display the **SheetView Collection Editor**, and in the **Members** list, select the sheet.
3. To set the row header (or column header) horizontal grid line color or vertical grid line color,
    1. Select the RowHeader object (or ColumnHeader object) in the property list, and expand the list of properties under that object.
    2. Select the **HorizontalGridLine** property or the **VerticalGridLine** property, and expand the list of properties under that object.
    3. If you want to display three-dimensional grid lines, set the **Type** property to Lowered or Raised.
    4. If the grid lines are not three-dimensional, select the **Color** property, and then click the drop-down button to display the color picker. Select a color in the color picker. If the grid lines are three-dimensional, select the **HighlightColor** property, and then click the drop-down button to display the color picker. Select a color in the color picker. Do the same for the **ShadowColor** property.
4. If you selected the sheet using the **Sheets Editor**, click **OK** to close the editor.

## Method to set

1. Create a [GridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.GridLine.html) object, setting the color or colors and the style for the grid line in the constructor.
2. Assign the [GridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.GridLine.html) object to the specified header by setting the [RowHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.html) object (or [ColumnHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.html) object) [HorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.HorizontalGridLine.html) or [VerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.VerticalGridLine.html) property to the [GridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.GridLine.html) object you created in step 1.
3. You can alternatively assign the [GridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.GridLine.html) object to the [RowHeaderHorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.RowHeaderHorizontalGridLine.html), [RowHeaderVerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.RowHeaderVerticalGridLine.html), [ColumnHeaderHorizontalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.ColumnHeaderHorizontalGridLine.html), or [ColumnHeaderVerticalGridLine](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.ColumnHeaderVerticalGridLine.html) properties in the SheetView object.

## Example

This example code sets the row header grid lines to be three-dimensional with red hues and the column header grid lines to be three-dimensional with blue hues as shown in the preceding figure.

```csharp
fpSpread1.Sheets[0].VisualStyles = FarPoint.Win.VisualStyles.Off;
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Renderer = new FarPoint.Win.Spread.CellType.ColumnHeaderRenderer();
fpSpread1.ActiveSheet.RowHeader.DefaultStyle.Renderer = new FarPoint.Win.Spread.CellType.RowHeaderRenderer();
FarPoint.Win.Spread.GridLine rgdln = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Raised, Color.Purple, Color.Red, Color.Orange);
FarPoint.Win.Spread.GridLine cgdln = new FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Raised, Color.Purple, Color.Blue, Color.LightBlue);
fpSpread1.Sheets[0].ColumnHeader.RowCount = 3;
fpSpread1.Sheets[0].RowHeader.ColumnCount = 2;
fpSpread1.Sheets[0].ColumnHeader.HorizontalGridLine = cgdln;
fpSpread1.Sheets[0].RowHeader.HorizontalGridLine = rgdln;
fpSpread1.Sheets[0].ColumnHeader.VerticalGridLine = cgdln;
fpSpread1.Sheets[0].RowHeader.VerticalGridLine = rgdln;
```

```vbnet
fpSpread1.Sheets(0).VisualStyles = FarPoint.Win.VisualStyles.Off
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Renderer = New FarPoint.Win.Spread.CellType.ColumnHeaderRenderer
fpSpread1.ActiveSheet.RowHeader.DefaultStyle.Renderer = New FarPoint.Win.Spread.CellType.RowHeaderRenderer
Dim rgdln As New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Raised, Color.Purple, Color.Red, Color.Orange)
Dim cgdln As New FarPoint.Win.Spread.GridLine(FarPoint.Win.Spread.GridLineType.Raised, Color.Purple, Color.Blue, Color.LightBlue)
fpSpread1.Sheets(0).ColumnHeader.RowCount = 3
fpSpread1.Sheets(0).RowHeader.ColumnCount = 2
fpSpread1.Sheets(0).ColumnHeader.HorizontalGridLine = cgdln
fpSpread1.Sheets(0).RowHeader.HorizontalGridLine = rgdln
fpSpread1.Sheets(0).ColumnHeader.VerticalGridLine = cgdln
fpSpread1.Sheets(0).RowHeader.VerticalGridLine = rgdln
```

## Using the Spread Designer

1. Select the sheet tab for the sheet for which you want to set the grid line colors. You can select the sheet from the drop-down list or select the sheet corner or select the Spread component, then select the **Sheets** property and display the **Sheets Editor**.
2. To set the row header (or column header) horizontal grid line color or vertical grid line color,
    1. In the **Appearance** category, select the **RowHeaderHorizontalGridLine** or **RowHeaderVerticalGridLine** object (or **ColumnHeaderHorizontalGridLine** or **ColumHeaderVerticalGridLine** object) in the property list, and expand the list of properties.
    2. If you want to display three-dimensional grid lines, set the **Type** property to Lowered or Raised.
    3. If the grid lines are not three-dimensional, select the **Color** property, and then click the drop-down button to display the color picker. Select a color in the color picker.
    4. If the grid lines are three-dimensional, select the **HighlightColor** property, and then click the drop-down button to display the color picker. Select a color in the color picker. Do the same for the **ShadowColor** property.
3. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.

## See Also

[Customizing the Style of Header Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headercustomize)
[Adding a Gradient to Header Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergradient)