c#组合框不显示选定的值

时间:2012-08-06 19:49:40

标签: c# data-binding binding combobox

据我所知,我已经定义了两个组合框:几乎相同:

<ComboBox AllowDrop="False" DataContext="{Binding}" Height="23" IsEnabled="True" IsSynchronizedWithCurrentItem="True" ItemTemplate="{StaticResource AccountTypeTemplate}" ItemsSource="{Binding}" Margin="0,12,90,0"  Name="AccountTypeCombo" VerticalAlignment="Top" SelectionChanged="AccountTypeCombo_SelectionChanged" HorizontalAlignment="Right" Width="84" Grid.Column="1" />

<ComboBox AllowDrop="False" DataContext="{Binding}" Height="23" IsEnabled="True" IsSynchronizedWithCurrentItem="True" ItemTemplate="{StaticResource AccountTemplate}"     ItemsSource="{Binding}" Margin="0,13,14,0" Name="AccountsList"     VerticalAlignment="Top" SelectionChanged="AccountsList_SelectionChanged"     HorizontalAlignment="Right" Width="576" />

虽然AccountType_Combo很好,但另一个(AccountsList)在选中时拒绝显示值,即使我获取所选值。

此外,当您将鼠标悬停在有问题的框上时,它似乎会显示另一个(可能是其自身)控件的一部分,您可以在其中看到文本。

我在c / pascal / C ++上花了很多年时间对c#progamming很陌生

有什么想法吗?

0 个答案:

没有答案
相关问题