I would like to have the checkbox column in my datagrid enabled/disabled for each row depending on a value in a collection. I have an ObservableCollection called AccountComponents that is a collection of a class called AccountComponent which has a boolean property called Enabled. I've tried binding the Enabled property to IsReadOnly and IsEnabled with no luck.
Here's XAML where I tried a DataGridCheckBoxColumn-
<DataGridCheckBoxColumn Binding="{Binding IsChecked}" IsReadOnly="{Binding AccountComponents/Enabled}"/>
Here's XAML where I tried a DataGridTemplateColumn-
<DataGridTemplateColumn Header="">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<CheckBox IsChecked="{Binding IsChecked,Mode=TwoWay}" IsEnabled="False"/>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<Grid>
<CheckBox IsChecked="{Binding IsChecked,Mode=TwoWay}" IsEnabled="{Binding Enabled}"/>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
Any help figuring this out is much appreciated.