문제

I have a dataset connected to a bindinglist that is connected to a combobox in win32.

I would like to make "Computer" to be selected as a displaymember in the combobox when I have a private string with value "Computer".

The main issue is that it doesn't work to use SelectedText in the combobox to make "Computer" to be selected but it works properly when I use selectedIndex. But, in order to use selectedIndex, you have to know the row number from table in order to make the text to be selected.

도움이 되었습니까?

해결책

(Not sure because of tags, I am assuming you are using WinForms for your application).

Try the following:

combobox.SelectedValue = "Computer";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top