开发者

WPF Combobox Items Vanishing/Reappearing from dropdown

开发者 https://www.devze.com 2023-01-21 03:51 出处:网络
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.

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.stack.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="Cent开发者_StackOverflow中文版er" 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


Ok, so it turned out it was a rendering issue with using a Virtual Machine!! If used on a physical machine, or rdp is used, it looks fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号