Quantcast
Channel: Latest Questions by sebj
Viewing all articles
Browse latest Browse all 12

Dropdown will not change selected item text after changing options list at runtime

0
0
I have a Dropdown UI control. If I clear the options list and repopulate it, the text of the selected item is not changed. It doesn't matter where or what the user clicks on, the only way to force the text to change is to alter the value member to a different value, and then put it back. This occurs when there is only one item in the new list, and when there is more than one. I have tried explicitly invoking OnValueChanged() but this still has no effect. **How do I force the Dropdown to reset/repaint/remove whatever caching its got after updating the options list?** I am resetting the options list like so: m_branchesDropdown.options.Clear(); foreach (var branch in m_branches) { m_branchesDropdown.options.Add(new Dropdown.OptionData() { text = branch.name }); }

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images