I want to change the CheckBox which is inside of a DataGridColumn into an image when it is checked and another when it is unchecked, How can i do ? Ps: My DataGridCheckBoxColumn
Use the ElementStyle and EditingElementStyle properties to create and set a different Template for the CheckBox
which fits that.
e.g.
This makes the column display an image based on IsChecked
, the URIs are just hardcoded and the CheckBox is disabled because editing in the ElementStyle does not change any properties on the bound object. Its only purpose is to display the approriate image.
(The EditingElementStyle
is not set here so if the user clicks the cell again to edit it a normal CheckBox appears which can be checked or unchecked.)