I can make it work, if I start by clearing the items, and then re-inserting them and selecting what I want, but it seems like a stupid solution to do that, just to change the selection.
Does anybody have a more elegant solution?
Brute force code that works:
public void SetString(string name) {...
I am writing an application, where I fill a combobox with strings and then select a value.
Sometimes, I want to programmatically change to another value, but I cannot get that to work.
Assignments to .Text or .SelectedItem does not work, and even if I start with setting the selectedIndex = -1...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.