开发者

WPF combo box weird problem

开发者 https://www.devze.com 2023-02-04 15:25 出处:网络
I am binding a SortedListbox to an WPF combo box. everything was fine. The problem happend when i select the first [only the first] item. The problem is that SelectedValue doesnt change when a new ite

I am binding a SortedListbox to an WPF combo box. everything was fine. The problem happend when i select the first [only the first] item. The problem is that SelectedValue doesnt change when a new item is selected after selecting first item. Suppose SelectedValue of the first item is '1' and the SelectedValue of third item in the combo is '3'. If i select the first item and then selected the third item. SelectedValue remains'1', when开发者_开发知识库 '3' is expected.

Any 1 faced similar problems.

Regards,

John.


Maybe you can try to use IsSynchronizedWithCurrentItem on your control.

<ComboBox IsSynchronizedWithCurrentItem="True" />


Unless you post the code for the combobox from xaml page, you won't be able to find the reason. Maybe your ComboBox.SelectedValue or ComboBox.SelectedItem isn't defined properly but nothing worthy can be said until code is seen

0

精彩评论

暂无评论...
验证码 换一张
取 消