I have a DataGrid in WPF.
The most left cell in every row is a CheckBox, which sets an Enabled property on the row's model (through a RowViewModel).
When the CheckBoxis unchecked on a certain row that row in the DataGrid should be disabled so all controls in the other columns of the row should be disabled, but not the CheckBox cell.
How can I easiest achieve that, still allowing the CheckBox cell to be enabled so the user can click the CheckBox in the most left cell in the row (so the user could still enable the object again hence making the complete row enabled as well)
You could define a cell style that with a trigger that binds to the source property of the
CheckBoxand sets theIsEnabledproperty of the cell tofalsewhen the source property returnsfalseortrue:You then set the
CellStyleproperty of all columns except the one with theCheckBoxto this style: