Why doesn't my binding update whenever EditingElementStyle AND ElementStyle are set to a custom styl

Posted by Pakman on Stack Overflow See other posts from Stack Overflow or by Pakman
Published on 2010-05-28T03:45:52Z Indexed on 2010/05/28 3:51 UTC
Read the original article Hit count: 256

Filed under:
|
|
|

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?!

Note: sometimes clicking around will produce an update to the binding (detected via debugging) - this is not the same as clicking another row to "commit" the value, though!

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf