Datagrid columns does not comes under the visual tree of the DataGrid
. hence you will need to use the BindingProxy to make ViewModel accessible to your DataGridTemplateColumn
. I have explained how to create and use BindingProxy
in the answer below:
Bind ViewModel property to DataGridComboBoxColum
Once you have setup the BindingProxy you can bind your DataGridTemplateColumn visiblity as
<DataGridTemplateColumn Header="Apply" Visibility="{Binding Path=Data.Visible, Source={StaticResource ProxyElement}"