Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Use the Excel Export API to Show and Hide Gridlines

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.

View Example

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

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