問題在WPF ComboBox
項目:與收藏displayvaluepath WPF組合框綁定,SelectedValuePath不工作
XAML:
<ComboBox x:Name="cboSelectSeries" Width="100" Height="25" Grid.Row="3"
Grid.Column="3" SelectedIndex="0"
ItemsSource="{Binding}" SelectedValuePath="SeriesNumber"
DisplayMemberPath="NId" />
XAML.cs
internal List<NPIS.PortableObject.NPIS> NCollection;
..
NCollection=getdata();
cboSelectSeries.DataContext = NCollection;
輸出:
與項目作爲「NPIS.PortableObject.NPIS」
其更好地設置的ItemSource你的情況...'cboSelectSeries.ItemsSource = NCollection;' – Sankarann
我想,太.. – Habeeb