I have placed a checkbox control in an auto-generated WPF datagrid ColumnHeaderStyle as shown below:
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<CheckBox x:Name="HeaderCheckBox" Content="{Binding}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.ColumnHeaderStyle>
How could I access the CheckBox in code behind? There would be multiple columns in datagrid, how could I find out (column-wise) checkbox is selected or not ?
Please suggest.