0

I have a table derived from a TableViewer. The table has many columns.I would like to hide few of the columns based on some condition. So i am programatically setting columnWidth(0) and resize to false for that table column i.e.

column.setWidth(0); column.setResizable(false);

I am getting a grey border when I use the above controls to hide in MAC. Grey Color

Could someone help me how to avoid this grey color getting appended at the end in MAC? Note:This works fine in Windows Systems. The width of the greycolor is propotional to the number of columns I hide :(

avojak
  • 2,342
  • 2
  • 26
  • 32
  • 2
    `I have a table derived from a TableViewer` - please provide a [MCVE](http://stackoverflow.com/help/mcve) with this code. I just tested [this related answer](http://stackoverflow.com/a/12517882/3300205) on my Mac and it worked just fine. – avojak Dec 01 '16 at 05:17
  • @avojak: Thanks for giving a reference to check the example.Unfortunately,the issue is still there with the example you pointed when you make it more than 30 columns.In the example you mentioned there are only 2 columns.Increase the number of columns and you can see the mentioned issue in MAC. – Topic_explorer Dec 01 '16 at 08:10

1 Answers1

3

I've mentioned this in one of my other answers: OSX requires a minimal width for columns, i.e. you can't make the column ant narrower than that minimum (probably just a few pixels, hence the gray).

Comment 11 of this Bug report mentions this as well.

So I'm afraid, hiding the column isn't an option. You could, however, dispose() it, but then you'd have to re-create it to get it back.

Community
  • 1
  • 1
Baz
  • 36,440
  • 11
  • 68
  • 94
  • :Thanks for the response.Is there any other workaround which can help me resolve this issue?My columns are dynamic.So based on the usecase the number of columns change.If there are more than 30 columns to show ,this gray colored pixel looks very ugly. – Topic_explorer Dec 01 '16 at 08:16
  • @user3844744 None that I know of. – Baz Dec 01 '16 at 08:18
  • 2
    @user3844744 You could `dispose()` the column, but then you'd have to re-create it to bring it back. – Baz Dec 01 '16 at 09:17