tags:

views:

23

answers:

1

how to bind combobox of wpf datagrid

A: 

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>
Victor
I'd bind the object collection to ItemsSource instead of DataContext, personally.
Benny Jobigan