We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Hiding columns after create not working correctly

Hello, 

I've come across a serious issue when modelling the spreadsheet component, and I can't seem to resolve it in anyway. If I try to hide a column by using the hideColumn function in JS, it's always the +1 column that gets hidden. For example, if I use hideColumn(0), it hides column B. However, if I use hideColumn(0,0,false), another column A appears in my spreadsheet. The same thing happens when I try to apply it through the context menu - right clicking on column A and selecting the hideColumn function actually hides column B, and so on. 

It turns out that when I try to hide column A, another column definition is created in sheet/properties/columns, with index -1. Keeping that in mind, I've managed to come up with a manual workaround that dynamically removes the -1 column and applies hidden to column 0 when needed, and it would've worked perfectly, had I not hit another wall. If I continuously hide/unhide columns using that, the number of them rendered shrinks, ultimately leaving me with no columns and no data displayed.

It's been really frustrating to deal with it, so I would appreciate any pointers here. 

Regards


6 Replies

SP Sangeetha Priya Murugan Syncfusion Team November 29, 2022 01:33 PM UTC

Hi,


If we provide hideColumn(0), which hides the A column, the hideColumn method works properly on our end. And if we select the B column and choose the Hide Column option from the context menu, it hides the B column, and so on. Please find the latest JavaScript spreadsheet sample link below.

 

Sample Link: https://stackblitz.com/edit/5zhvv5?file=index.js

 

And we suspect that you have used the oldest version for Syncfusion scripts and assemblies. So, we suggest you use our latest version (20.3.58) for both scripts and assemblies to resolve your reported issue. If you are still facing the same issue, please get back to us with the sample level customization codes or runnable sample. Based on that, we will check and provide you with a better solution quickly.



WI will January 6, 2023 08:40 AM UTC

This is a known bug in some versions of Excel. Although this option is not selected by default, it's possible to set it accidentally by pressing a particular keyboard shortcut (CTRL+6). To work around the bug, you must change the setting from Nothing (hide objects) to All.


Regrads,

Will



SP Sangeetha Priya Murugan Syncfusion Team January 9, 2023 09:10 AM UTC

Hi Will,

 

As we have stated in our previous update, please share the requested details to proceed further because the reported issue does not occur on our end. It will be helpful for us to check this issue and provide you with a better solution quickly.




PG Peter Groft January 13, 2023 08:52 AM UTC

Hide columns

Select one or more columns, and then press Ctrl to select additional columns that aren't adjacent.

Right-click the selected columns, and then select Hide.


Unhide columns

Select the adjacent columns for the hidden columns.

Right-click the selected columns, and then select Unhide.


Or double-click the double line between the two columns where hidden columns exist.


This May Help,

Peter



SP Sangeetha Priya Murugan Syncfusion Team January 17, 2023 12:25 PM UTC

Hi Peter,


We need to validate more on our reported query, so we will update you the further details on January 19th 2022. We appreciate your patience until then


Regards,

Sangeetha M



SP Sangeetha Priya Murugan Syncfusion Team January 19, 2023 01:04 PM UTC

Hi Peter,

 

Currently, we don’t have ctrl key selection (discontinuous range) actions (hide/show, copy/paste etc.) in a spreadsheet. However, we have considered this as an improvement, but we don't have any immediate plans to implement it in the near future. It will be available in any of our upcoming releases. We appreciate your patience until then. You can track the status of this improvement using the link below from our feedback portal. 



Feedback Portal Link
: https://www.syncfusion.com/feedback/40489/provide-show-hide-support-with-discontinuous-range-selection-ctrl-key-selection


Loader.
Live Chat Icon For mobile
Up arrow icon