DataGridTemplateColumn + ListBox = Filtered Listbox?

Feb 11, 2009 at 3:25 AM
I have a DataGrid with a DataGridTemplateColumn that contains a ListBox of related objects.   The listbox's ItemTemplate is  a checkbox bound and the ItemSource is a list of lookup values.  If a value is selected, the checkbox is checked.

For some reason, the listbox displays only the items that are selected(checked).  If the I listbox that is defined outside of the grid it shows all records with the appropriate items selected.

                    <tk:DataGridTemplateColumn x:Name="InjuryComplaintColumn" Header="Injury/Complaint" MinWidth="150">
                        <tk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding ConditionSummary}" x:Name="ConditionSummaryTextBlock"/>
                            </DataTemplate>
                        </tk:DataGridTemplateColumn.CellTemplate>
                        <tk:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                    <ListBox x:Name="ConditionListBox" SelectionMode="Multiple"  MinHeight="200" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                             ItemsSource="{Binding ConditionChartItems}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <CheckBox x:Name="ConditionCheckBox" IsChecked="{Binding IsSelected}" Content="{Binding DataValue}" />
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>
                            </DataTemplate>
                        </tk:DataGridTemplateColumn.CellEditingTemplate>
                    </tk:DataGridTemplateColumn>

Does anyone know why the listbox would only show those items selected when inside the grid?

Thanks