From what I can see from the provided code you click in the ComboBox
(which would open the dropdown) and then you call the SelectItem
method with second parameter true, which would click again in the ComboBox
and it would close it. The closing would occur before the item is selected and you would observe open and close of the dropdown without selecting an item. Please note that this is just a guess and in order to fix it you can try removing the first click.
Nevertheless as this might not be the exact issue you are facing I am attaching a sample project with a test showing how you can select item from ComboBox
Also, please note that before the dropdown of the ComboBox
is opened its items are not loaded in the visual tree and the ItemElements
collection would be empty. So in order to work correctly you would need to open the dropdown, call the Refresh
method of the ComboBox (in order to refresh it and particularly to populate the ItemElements
collection, this is recommended in scenarios when there are elements shown\hidden) and then select item from the ItemElements
collection. This approach can be also found in the attached project.
Hope this would help.
Telerik by Progress