First you need a BooleanToVisibilityConverter to Converter bool to Visibility

MaterialDesignThemes has already owned one

add follow code to your xaml file

1
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
1
<converters:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />

refer to

http://stackoverflow.com/questions/22073740/binding-visibility-for-datagridcolumn-in-wpf

DataGridTextColumn or any other supported dataGrid columns doesn’t lie in Visual tree of DataGrid, so the solution is:

we add

1
<FrameworkElement x:Name="dummyElement" Visibility="Collapsed" />

to UserControl under Grid

just like this

1
2
3
4
5
    <Grid>
        <FrameworkElement x:Name="dummyElement" Visibility="Collapsed" />
.....
.....
</Grid>

then use it

1
<DataGridTemplateColumn Width="Auto"                                                  Header="MyColumn"                                                 Visibility="{Binding DataContext.isVisible,                                                                   Converter={StaticResource booleanToVisibilityConverter},                                                                      Source={x:Reference dummyElement}}">

done