i have a datagrid that contains 3 DataGridTemplateColumns that hold radioButtons. now i want to control the "isEnabled" property of the radioButtons from a click event of a button in my code behind:
<DataGrid AutoGenerateColumns="False" Height="300" x:Name="dgEmps"
RowEditEnding="gridEmps_RowEditEnding" CellEditEnding="gridEmps_CellEditEnding"
FlowDirection="RightToLeft"
SelectionChanged="gridEmps_SelectionChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Shift Manager">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<RadioButton GroupName="{Binding EmployeeId}"
IsChecked="{Binding IsManager, Mode=TwoWay}" x:Name="dgrIsManager"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Waiter" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<RadioButton GroupName="{Binding EmployeeId}"
IsChecked="{Binding IsWaiter, Mode=TwoWay}" x:Name="dgrIsWaiter"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Cook" IsReadOnly="True" x:Name="aaa">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<RadioButton GroupName="{Binding EmployeeId}"
IsChecked="{Binding IsCook, Mode=TwoWay}" x:Name="dgrIsCook"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
the thing is that the "IsReadOnly" property doesn't work and i can't seem to access the radioButton properties from my code (not even by the x:name i declare in the xaml). i tried this: WPF Toolkit DataGrid SelectionChanged Getting Cell Value and many other tutorials/ blog posts but couldn't make it work. any ideas?