DataGrid列中绑定Combox

正常情况下的Combox绑定回传不会失效:但是在DataGrid中选择Combox属性后不会回传:即调用Set属性

如图中的模板:

DataGrid中Combox bingding string

显示的方式有三种:

  第一种: 

  Text="{Binding CheckAdvice2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"

  第二种:

  SelectedValuePath="Content"
  SelectedValue="{Binding CheckAdvice2, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"

  第三种:SelectedIndex="{Binding CheckAdvice2,Converter={StaticResource StringToIndexConverter}, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"

但是不管哪一种写法都要写上:UpdateSourceTrigger=PropertyChanged否则不会调用Set属性

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案