Hi,
I'm having some problem with the synchronizing the combobox, when ItemsSource updates.
When I select an object and the combobox update, the item is perfectly synchronized with the selected objects value.
My problem is that my application poll new items every 10 sec and update/refresh the itemssource. I'm using isSynchronizedWithCurrentItem = true and the combobox just set the first item by default, instead of displaying the actual value from the selected object, as before the itemssource updated.
How can I fix this?
4 Answers, 1 is accepted
I am guessing that this behavior comes from the fact that you are updating the items source with new items. Basically, when you update the source collection with new items the previously selected item container is removed. What I can suggest you try on your side is after the update logic is performed, manually search in the new collection the selected item before the update. If such item exists, set this new item to the SelectedItem property of the RadComboBox.
Regards,
Dinko
Progress Telerik
Okay, atm I'm adding a new item to the observablecollection with a task that pull down a new item from the database every 10 seconds. If I pull down a new item which does not exist in my observablecollection, then I'm adding it to the ObserveableCollection.
When I check my observeable collection getter, I can see that the new item is in the collection, but somehow my GUI doesn't refresh. Why doesn't it? If I manually add through the UI, then it works perfectly.
Thank for your additional clarifications.
I tried to reproduce this behavior on my side but I think I am missing a specific step from your implementation. You can find the test project attached to this reply. In the project, I am adding a new item to the ObservableCollection which the RadComboBox is bound for on every 1 second. You can open the drop down to see the new items. Give this project a try and let me know what I am missing.
Regards,
Dinko
Progress Telerik