How can I dynamically hide columns from a grid?

I wanted to use removeColumn(“idOfColumn”) to hide a column, if a certain boolean variable equals true.
The boolean variable is set dynamically, i.e. while the app is running.

Although the variable was set to true during runtime, the column did not disappear.

Have you tried Grid.getColumn(“myColumn”).setHidden(true); ?

Thank you for your comment … I also tried setHidden() … the problem is the same: hiding a column dynamically (making a column that is being shown at the start of the program disappear during runtime) does not work …

What’s the dynamic event that should change the column’s visibility?