开发者

How do I bind a ComboBox

开发者 https://www.devze.com 2022-12-24 16:09 出处:网络
I have a ComboBox and need to bind it to a开发者_如何学Go DataGrid. How can I do that?For example:

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消