How do I bind a ComboBox
I have a ComboBox
and need to bind it to a开发者_如何学Go DataGrid
. How can I do that?
For example:
<tk:DataGrid x:Name="dgProducts" DataContext="GoodsCollection" IsSynchronizedWithCurrentItem="True" >
<tk:DataGrid.Columns>
<tk:DataGridComboBoxColumn Header="Good Name"
x:Name="dgCbProduct"
TextBinding="{Binding Path=GoodID, Converter={StaticResource GoodIDToGoodNameConverter}}"
SelectedValuePath="GoodName"
DisplayMemberPath="GoodName">
</tk:DataGridComboBoxColumn>
</tk:DataGrid.Columns>
</tk:DataGrid>
精彩评论