views:

13

answers:

2

I have an itemtemplate for a listbox, that is bounds to objects in a list. The properties of each of the objects in this list is bool, List< string >, string, string.

Bool is mapped to the checkbox, the List< string > feeds the dropdown on each of the rows, and the remaining two strings are mapped to each of the textboxes.

All fine - when I click on the combobox, dropdown appears ok.

UNTIL move the cursor from directly over the original footprint of the combobox control, to select an item from the dropdown:

http://i.imgur.com/igdTJ.png

As can be seen, as I move the cursor, the entry in the dropdown appears, but the rest of the contents of the dropdown dissappears. VERY strange! Any ideas? My xaml is as below, you shouldn't find anything particularly strange in it:

<StackPanel Orientation="Vertical" >
    <StackPanel CanVerticallyScroll="True" Orientation="Horizontal">
        <Label HorizontalAlignment="Left" VerticalAlignment="Center" Content="Key" />
        <Label HorizontalAlignment="Left" VerticalAlignment="Center" Content="Source Fields" />
        <Label HorizontalAlignment="Left" VerticalAlignment="Center" Content="Source Values" />
        <Label HorizontalAlignment="Left" VerticalAlignment="Center" Content="Target Field"/>
     </StackPanel>   
    <ListBox ItemsSource="{Binding FieldMap.SourceTargetFieldMap, Mode=Default}">
  <ListBox.ItemTemplate>
   <DataTemplate>
                <StackPanel Orientation="Horizontal" Margin="5,5,5,5">
                 <CheckBox Name="ckbKeyField" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Height="Auto" IsChecked="{Binding Path=Key, Mode=TwoWay}" />
                    <ComboBox Name="cbSourceField" SelectedValuePath="FieldName" SelectedValue="{Binding Path=SourceField, Mode=TwoWay}" DisplayMemberPath="FieldName" ItemsSource="{Binding SourceFieldValues}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="120" />
                    <TextBox Name="tbSourceValue" Margin="5,0,0,0" Text="" TextWrapping="Wrap"  Width="115" />
                 <TextBox Name="tbTargetField" Margin="5,0,0,0" Text="{Binding Path=TargetField}" TextWrapping="Wrap" Width="155" IsReadOnly="True"/>
             </StackPanel>     
   </DataTemplate>
  </ListBox.ItemTemplate>
 </ListBox>
</StackPanel>

Any ideas??? I have scoured the web for answers, but alas I have none...

Cheers,

Matt

A: 

List< string >

If your type is really list of strings - remove properties SelectedValuePath and DisplayMemberPath from the Combobox.

vorrtex