Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Adding Checkbox in Record Selectors fails


Does anyone know how to solve the following problem ?

I have a grid which datasource is filled based on a stored procedure. In the xaml I have added the styles for the checkbox for each record and for the header. 

The problem is that if I click the header checkbox, this gets selected but all the records remain unchecked. I have no idea how I can change this such that all the records are checked/unchecked too. Probably there is a simple trick, can someone help me ?


C# code:

xamMainGrid.DataSource = MyLinqConn.loadMainGridOverview(strcomboValuationDate, decThreshold, strActiveFlag);

List<pAppDealPriceOverviewResult> loadMainGridOverview

XaML code:

<!-- This Style puts a CheckBox into the record selectors. -->
                                <Style BasedOn="{x:Null}" TargetType="{x:Type igDP:RecordSelector}">
                                    <Setter Property="Control.Template">
                                            <ControlTemplate TargetType="{x:Type igDP:RecordSelector}">
                                                <CheckBox HorizontalAlignment="Center" IsChecked="{Binding Path=DataItem.IsChecked, Mode=TwoWay}" VerticalAlignment="Center" Checked="fRecordChecked" Unchecked="fRecordUnChecked" />
                                <!-- This Style puts a CheckBox into the header area above the record selectors. -->
                                <Style TargetType="{x:Type igDP:HeaderPrefixArea}" BasedOn="{x:Null}">
                                <Setter Property="Visibility" Value="Visible" />
                                <Setter Property="Template">
                                        <ControlTemplate TargetType="{x:Type igDP:HeaderPrefixArea}">
                                                <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding Path=DataPresenter.DataContext.AllMembersAreChecked, Mode=TwoWay}" Checked="fAddAllRecordsToCheckList" Unchecked="fRemoveAllRecordsFromCheckList" />