accessing checkboxes in wpf datagrid header

Nov 23, 2011 at 10:32 AM

OK.....i need some help

        <DataGrid x:Name="datagrid1" AutoGenerateColumns="True">
                            <CheckBox Name="ChkAll" Checked="ChkAll_Checked"  Unchecked="ChkAll_Unchecked"  IsThreeState="False" Padding="4,3,4,3" HorizontalContentAlignment="Center" HorizontalAlignment="Center"/>
<DataGridTemplateColumn.CellTemplate> <DataTemplate> <CheckBox Name="Chk" Tag="{Binding}" Checked="Chk_Checked"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid> </Grid>

As can be seen in the above code, i have a "Check All" checkbox in the headerTemplate....i want to access the checkbox via code behind....any ideas how i can access it ?? I just want the part which brings me the element from the header....

Thanks in advance....

Nov 24, 2011 at 4:42 AM

Come on Guys!!! Need some help here!!!!