In my Visual Studio 2010 WPF application, I have the following (simplified) style:
<Style x:Key="MyStyle" TargetType="{x:Type CheckBox}">
<Setter Property="Background" Value="Blue" />
</Style>
If I use it as the ElementStyle AND EditingElementStyle in my DataGridCheckBoxColumn:
<DataGridCheckBoxColumn Binding="{Binding IsEnabled}"
ElementStyle="{StaticResource MyStyle}"
EditingElementStyle="{StaticResource MyStyle}" />
Then my binding, IsEnabled
, does not toggle when I check/uncheck a row's checkbox. If I remove either ElementStyle, EditingElementStyle, or both, then the binding updates no problem. Why is this?!
Also, I tried to work around the problem using the following code:
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsEnabled}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
However, the problem remains.