The columns of a DataGrid
are abstract objects not appearing in the visual or logical tree. You cannot use ElementName
and RelativeSource
. Source
in combination with x:Reference
should work though:
Visibility="{Binding Source={x:Reference chkColumnVisible},
Path=IsChecked,
Converter={StaticResource BooleanToVisibilityConverter}}"