Toggle columns visibility using getRange and visible()

Posted by: davide.vago on 1 August 2019, 8:47 am EST

  • Posted 1 August 2019, 8:47 am EST

    Good morning/afternoon

    I’m trying to create a functionality within a sheet instance capable to toggle the visibility (on/off) of certain ranges of columns

    I found the following topic (see below) which comes from 2018 and I tried to implement the same logic, however once the columns are set to visible(false) there is no way to reset the visibility as true.

    My code looks something like this:

    
    // this.activeSheet is coming from getActiveSheet() of GC.Spread.Sheets.Workbook
    
    this.activeSheet.getRange(-1, 0, -1, 20).visible(true)
    
    

    Apparently passing visible() or visible(true) or visible(‘blah’) doesn’t set the visibility back to normal

    Ref. https://www.grapecity.com/forums/spread-sheets/how-to-hide-columns-or-row#original-post

  • Posted 1 August 2019, 11:18 am EST

    Apologies for this post, the code on getRange works fine, the problem is that the scrollbar moves automagically horizontally so the user doesn’t see the content when columns are toggled back just because the “visible” columns are off the viewport.

    It’s possible to solve the problem just using showColumn

    Thanks

  • Posted 2 August 2019, 2:39 am EST

    Hi,

    We are glad that you were able to resolve the issue. Please let us know if you face any further issues.

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels