3
votes

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.

2
Weird indeed. I used the combo box in Silverlight without any problem, I would assume it works too in WPF. - Falanwe
posting you xaml code may help you lot in your problem - Binil

2 Answers

1
votes

Maybe you can try to use IsSynchronizedWithCurrentItem on your control.

<ComboBox IsSynchronizedWithCurrentItem="True" />
0
votes

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