Skip to main content

IXlSheetViewOptions.ShowGridLines Property

Gets or sets whether worksheet gridlines are visible.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

bool ShowGridLines { get; set; }

Property Value

Type Description
Boolean

true, to display worksheet gridlines; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to ShowGridLines
IXlSheet
.ViewOptions .ShowGridLines

Remarks

The image below shows the worksheet when gridlines are displayed, and when gridlines are hidden (the workbook is opened in Microsoft® Excel®).

XLExport_ViewOptions_ShowGridlines

Example

The example below demonstrates how to control the visibility of worksheet gridlines (the faint lines that separate rows and columns in a worksheet). To do this, use the IXlSheetViewOptions.ShowGridLines property of the IXlSheetViewOptions object that contains worksheet display settings and can be accessed using the IXlSheet.ViewOptions property.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/excel-export-api-examples

// Create a worksheet. 
using (IXlSheet sheet = document.CreateSheet())
{
    // Hide gridlines on the worksheet.
    sheet.ViewOptions.ShowGridLines = false;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowGridLines property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also