0
J'ai un ComboBox
et besoin de le lier à un DataGrid
. Comment puis je faire ça?Comment lier un ComboBox
J'ai un ComboBox
et besoin de le lier à un DataGrid
. Comment puis je faire ça?Comment lier un ComboBox
Par exemple:
<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>
Je lierais la collection d'objets à ItemsSource au lieu de DataContext, personnellement. –
Répétition du titre dans le corps de la question aide à personne. –