albicelestial
albicelestial

Reputation: 145

ComboBox & SelectedItem setting on dropdown opening

I have a ComboBox control of DropDown type which contains items "Vx", "V", "G", "g".

Edit field text is "V" ( :)

The problem is: when I open dropdown list, item "Vx" highlighted as selected, not "V". So I assume combobox uses FindString to find SelectedItem - so search result is equivalent to first matched item by case-insensitive string.StartsWith.

The question is: how I can override this behaviour to find full-matched item? I need case-sensitive search with full equivalent of strings, not only StartsWith. For entered "V" i need item "V" (not "Vx") to be selected when combobox dropdown list is opening.

Thank you for replies.

Upvotes: 2

Views: 818

Answers (1)

NascarEd
NascarEd

Reputation: 1390

Do you need to type in the combo box? If not, change the DropDownStyle to DropDownList.

Upvotes: 1

Related Questions