NativeExcel for .Net Developer's Reference

IWorksheet.DisplayGridlines Property

Gets or sets a value that indicates whether or not the grid lines are displayed.

[Visual Basic]
PropertyDisplayGridlinesAsBoolean
[C#]
boolDisplayGridlines{get;set;}
[C++]
__propertyboolget_DisplayGridlines();
__propertyvoidset_DisplayGridlines(bool);
[JScript]
functiongetDisplayGridlines():bool
functionsetDisplayGridlines(bool);

Property Value

True if grid lines are displayed; otherwise, false.

Remarks

This property affects only displayed grid lines. Use the PageSetup.PrintGridlines property to control the printing of grid lines.

Example

This example toggles the display of gridlines in the first sheet.

[C#]
IWorksheet sheet = book.Worksheets[1];
sheet.DisplayGridlines = !sheet.DisplayGridlines; 
[VisualBasic]
Dim sheet As IWorksheet = book.Worksheets(1)
sheet.DisplayGridlines = Not sheet.DisplayGridlines 
[C++]
IWorksheet* sheet = book->Worksheets->Item[1];
sheet->DisplayGridlines = !sheet->DisplayGridlines; 

See Also

IWorksheet Interface | NativeExcel Namespace | PrintGridlines Property