I have such XAML:
<DataGrid DataContext="{Binding Path=Groups[0]}" ItemsSource="{Binding Path=FactorGroupList}"
AutoGenerateColumns="False" CanUserAddRows="False"
Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" RowHeaderWidth="0"
BorderThickness="0" Background="Transparent"
>
<DataGrid.Columns>
<DataGridTextColumn Header="Фактор" Width="*" Binding="{Binding FactorName}"/>
<DataGridTextColumn Header="Знач. (%)" Width="70" Binding="{Binding FactorValue}" IsReadOnly="{Binding isChild}"/>
<DataGridCheckBoxColumn Header="Активен" Width="70" Binding="{Binding FactorVisible}"/>
</DataGrid.Columns>
</DataGrid>
I want to make cells IsReadOnly=true
by binding it to bool object’s property isChild
.
This IsReadOnly="{Binding isChild}"
doesn’t work.
Is there any way to do so that the cell is only editable if the object field is false?