Back to Devexpress

WorksheetView.ShowGridlines Property

officefileapi-devexpress-dot-spreadsheet-dot-worksheetview-45775ecf.md

latest7.3 KB
Original Source

WorksheetView.ShowGridlines Property

Gets or sets whether worksheet gridlines are visible.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool ShowGridlines { get; set; }
vb
Property ShowGridlines As Boolean

Property Value

TypeDescription
Boolean

true to display worksheet gridlines; otherwise, false.

|

Remarks

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

Example

Use the Worksheet.ActiveView.ShowGridlines property to display or hide worksheet gridlines.

Note

The Worksheet.PrintOptions.PrintGridlines property allows you to specify whether worksheet gridlines should be printed. Refer to the following help topic for more information on how to specify print options for a worksheet: How to: Specify Print Settings.

The following example hides gridlines for the first worksheet in a workbook:

View Example

csharp
workbook.Worksheets[0].ActiveView.ShowGridlines = false;
vb
workbook.Worksheets(0).ActiveView.ShowGridlines = False

The following code snippets (auto-collected from DevExpress Examples) contain references 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.

winforms-spreadsheetcontrol-api-part1/CS/SpreadsheetControl/SpreadsheetActions/WorksheetActions.cs#L113

csharp
// Hide gridlines in the first worksheet.
workbook.Worksheets[0].ActiveView.ShowGridlines = false;
#endregion #ShowHideGridlines

winforms-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_API_Part02/SpreadsheetActions/ProtectionActions.cs#L68

csharp
worksheet.ActiveView.ShowGridlines = false;
workbook.EndUpdate();

wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/ProtectionActions.cs#L66

csharp
worksheet.ActiveView.ShowGridlines = false;
workbook.EndUpdate();

wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/SpreadsheetActions/WorksheetActions.cs#L131

csharp
// Hide gridlines in the first worksheet.
workbook.Worksheets[0].ActiveView.ShowGridlines = false;
#endregion #ShowHideGridlines

spreadsheet-document-api-examples-part1/CS/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.cs#L124

csharp
// Hide gridlines on the first worksheet.
workbook.Worksheets[0].ActiveView.ShowGridlines = false;
#endregion #ShowHideGridlines

winforms-spreadsheetcontrol-api-part1/VB/SpreadsheetControl/SpreadsheetActions/WorksheetActions.vb#L115

vb
' Hide gridlines in the first worksheet.
            workbook.Worksheets(0).ActiveView.ShowGridlines = False
' #End Region ' #ShowHideGridlines

winforms-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_API_Part02/SpreadsheetActions/ProtectionActions.vb#L74

vb
worksheet.ActiveView.ShowGridlines = False
workbook.EndUpdate()

wpf-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/ProtectionActions.vb#L72

vb
worksheet.ActiveView.ShowGridlines = False
workbook.EndUpdate()

wpf-spreadsheetcontrol-api-part-1/VB/SpreadsheetControl_WPF_API/SpreadsheetActions/WorksheetActions.vb#L119

vb
' Hide gridlines in the first worksheet.
            workbook.Worksheets(0).ActiveView.ShowGridlines = False
' #End Region ' #ShowHideGridlines

spreadsheet-document-api-examples-part1/VB/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.vb#L121

vb
' Hide gridlines on the first worksheet.
            workbook.Worksheets(0).ActiveView.ShowGridlines = False
#End Region ' #ShowHideGridlines

See Also

PrintOptions

How to: Specify Print Settings

WorksheetView Interface

WorksheetView Members

DevExpress.Spreadsheet Namespace