我有一个包含ComboBox作为列的DataGrid.
让我们考虑DataGrid将ItemsSource作为ObservableCollection而ComboBox ItemsSource是List.
我想基于DataGrid ItemsSource中的属性设置ComboBox SelectedItem属性.
但是,Product类具有类型为int而不是ProductType的属性ProductTypeId.
那么如何设置ComboBox SelectedItem以使其显示Product.ProductTypeId的值.而且我想将SeletedItems与Mode = TwoWay绑定,这样每当ComboBox SelectedItem发生变化时,它都会反映在DataGrid的ItemsSource中.
任何帮助将非常感激.
谢谢.