Updating a ComboBox SelectedItem from code behind

后端 未结 2 1598
离开以前
离开以前 2021-01-24 11:39

im having a View with a ComboBox bound to my viewModel property. Everything works fine but i actually want to reuse my View and need to update the controls with a given value.

2条回答
  •  广开言路
    2021-01-24 12:02

    It may happen if you do not Items collection doesn't contain an item equal to SelectedItem. Check whether you have such an item (it may be that you just forgot to overload Equals in your class and it uses references comparison)

提交回复
热议问题