标题
模板,因此它只能更改列标题的属性(不是完整的列,即单元格)。
没有
Style
对于
DataGridTextColumn
DataTrigger
. 但是转换器应该可以。
然而,另一个问题是列不在可视化树中,所以不能使用
ElementName
或
RelativeSource
,它们根本不起作用。有一个简单的问题
workaround
<Window.Resources>
<BooleanToVisibilityConverter x:Key="converter" />
<local:BindingProxy x:Key="proxy" Data="{Binding}" />
</Window.Resources>
...
<DataGridTextColumn Header="MyColumn"
Binding="{Binding MyProperty}"
Visibility="{Binding Data.MyboolProperty, Source={StaticResource proxy}, Converter={StaticResource converter}}" />