Version

Configuring the Gridlines (Infragistics Excel Engine)

Topic Overview

Purpose

This topic explains how to show or hide the gridlines and set their color.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

In this section you will find information that will help you to better understand the object model and the functionalities of the Infragistics Excel Engine.

In this topic

This topic contains the following sections:

Introduction

Gridlines summary

The gridlines are used to visually separate the cells in the worksheet. You may show or hide the gridlines and also change their color.

The following screenshot shows the gridlines displayed with their default gray color:

ExcelEngine_02.png

Gridlines Configuration Summary

Gridlines configuration summary chart

The following table explains briefly the configurable aspects of the gridlines and maps them to the properties that configure them.

Configurable aspect Details Properties

Shows or hides the gridlines.

Sets the gridlines’ color.

Showing/Hiding

Overview

You can show or hide the gridlines using the ShowGridlines property.

Property settings

The following table maps the desired configuration to the property settings that manage it.

In order to: Use this property: And set it to:

Show the gridlines

ShowGridlines

True

Hide the gridlines

ShowGridlines

False

Example

The following code snippet demonstrates how to show the gridlines on the first worksheet of the opened workbook.

In Visual Basic:

Me.spreadsheet1.Workbook.Worksheets(0).DisplayOptions.ShowGridlines = True

In C#:

this.spreadsheet1.Workbook.Worksheets[0].DisplayOptions.ShowGridlines = true;

Setting the Color

Overview

You can configure the gridlines’ color using the GridlineColor property.

Property settings

The following table maps the desired configuration to the property settings that manage it.

In order to: Use this property: And set it to:

Set the gridlines’ color

GridlineColor

A value of type Color

Example

The following code snippet demonstrates how to set the gridlines’ color to red.

In Visual Basic:

Me.spreadsheet1.Workbook.Worksheets(0).DisplayOptions.GridlineColor = Colors.Red

In C#:

this.spreadsheet1.Workbook.Worksheets[0].DisplayOptions.GridlineColor = Colors.Red;

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to show or hide the column and row headers.

This topic explains how to prevent the user from editing the cell values in a worksheet.

This topic explains how to programmatically set the zoom level in a worksheet.