Page 1 of 1

How to hide the active sheet grid lines?

PostPosted: Sun Apr 11, 2021 11:31 am
by eeigor
Is there a replacement for the Uno-method of dispatcher?
Code: Select all   Expand viewCollapse view
Sub ToggleSheetGrid
   Dim document As Object, dispatcher As Object

   document = ThisComponent.CurrentController.Frame
   dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   dispatcher.executeDispatch(document, ".uno:ToggleSheetGrid", "", 0, Array())
End Sub


How do I know if the active sheet grid lines are currently displayed?

An example of a non-uniform approach.
E.g. Why it affects all sheets:
>>> ThisComponent.CurrentController.ShowGrid = True
And this one only for the active sheet:
>>> ThisComponent.CurrentController.freezeAtPosition(0, 1)

Re: How to hide the active sheet grid lines?

PostPosted: Sun Apr 11, 2021 11:48 am
by Zizi64

Re: How to hide the active sheet grid lines?

PostPosted: Sun Apr 11, 2021 11:52 am
by Zizi64
A workaround tip:

Use Cell styles with colorized cell background (at least with white color), then the grid lines will be invisible on the sheet.

(Or just use the Dispatcher method)

Re: How to hide the active sheet grid lines?

PostPosted: Sun Apr 11, 2021 12:48 pm
by Zizi64

Re: How to hide the active sheet grid lines?

PostPosted: Sun Apr 11, 2021 6:22 pm
by eeigor
ThisComponent.CurrentController.ShowGrid = True
This looks like a 10 year-old bug.
ODS's file 'settings.xml' contains the 'ShowGrid' property for each sheet.
<config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>