Joan Venge
Joan Venge

Reputation: 331440

How to hide a GridViewColumn as if it's collapsed at runtime in WPF?

Basically I have some CheckBox controls I want to use to show or hide certain GridViewColumns at runtime. But I failed to find a sort of IsVisible property that I can set to false. Or even a Visibility property that exist only on GridViewColumnHeader.

Any ideas on how to do this?

Upvotes: 1

Views: 2781

Answers (1)

Dave White
Dave White

Reputation: 3461

Set the GridViewColumn Width property to 0. This will achieve the same effect as hiding it. This can be achieved with DataBinding and a Converter.

Upvotes: 6

Related Questions