I have a Datagrid in whitch I have a column who has a CheckBox inside (I know that DataGridCheckBoxColumn exist but I don't like the behavior (clicking once to select and a second time to alter the value)).
This checkbox is binded this way
<DataGridTemplateColumn x:Name="checkColumn" Header="Check">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding load, Mode=TwoWay}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
The TwoWay mode is supposed to be default but I added it anyway since it seems to work as if it was read only.
And the property load is simply
private bool _load;
public bool load
{
get { return _load; }
set { _load = value;}
}
But in the end the binding doesn't work properly. For each item I have the correct value displayed by default (checked/not checked), but if I check/uncheck the checkboxes, nothing changes on the data (but the checkboxes do change visually, but the setter of the item is never called).
I suspect that the problem is not a big one, since the default values are read, the binding is not completely wrong, but I can't find out why the setter is never called.
Aucun commentaire:
Enregistrer un commentaire