WPF开发当中,我发现ComboBox默认选中逻辑失效了,仔细查找后发现后台逻辑并没有出现问题

测试后发现在XAML中,ComBoBox控件的SelectedValue属性需要写在ItemSource之前,默认选中又恢复正常了。

<ComboBox SelectedValue="{Binding TypeValue}" ItemsSource="{Binding CmbListItem}" SelectedItem="{Binding CmbSelectItem}" SelectedValuePath="TypeValue" DisplayMemberPath="Member"/>

搬运转发请链接注明出处。

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2021-10-31
  • 2021-11-06
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
相关资源
相似解决方案