且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

DataGrid 数据绑定/更新中的 WPF ComboBox 不起作用

更新时间:2022-12-27 15:51:43

我怀疑您需要使 SelectedItem 绑定更新 PropertyChanged 上的源才能使其工作.

I suspect you'll need to make the SelectedItem binding update the source on PropertyChanged for this to work.

SelectedItem="{Binding Path=MyValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

SelectedItem="{Binding Path=MyValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

我会在调试时让 CellTemplate 和 CellEditingTemplate 都引用您的编辑模板,以消除另一个不相关的模板,直到您将其整理好.

I'd make the CellTemplate and CellEditingTemplate both reference your edit template while debugging this, to eliminate the other, irrelevant, template until you get it sorted out.