WPF: set false as default for all checkbox controll

76 Views Asked by At

I have many checkbox binding nullable bool values and when I press on the control, if it's set to null, I have to press twice to get true. Is it possible to have true as the first value or false as default when I have null for all the checkbox, for example with a style?

I've tried with this before, and it works:

<CheckBox  IsThreeState="False" IsChecked="{Binding MY_NULLABLE_PROPERTY, TargetNullValue=false}"/>

but I would like a generic solution for each control

EDITED:

I need to handle the problem for checkbox inside datagrid as well

0

There are 0 best solutions below