ComboBox bug?
-
I have a combo box whose items are load from a List (List is not empty). I already set SelectedIndex = 0 to choose the first item in code. But at runtime, when I click the arrow, drop down list appear and I don't select any item, SelectedIndex will be set to -1. If I select an item, SelectedIndex will be other than -1. I think SelectedIndex should be 0 even I click the arrow and don't select any item. Is there any body has same problem?
I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing
-
I have a combo box whose items are load from a List (List is not empty). I already set SelectedIndex = 0 to choose the first item in code. But at runtime, when I click the arrow, drop down list appear and I don't select any item, SelectedIndex will be set to -1. If I select an item, SelectedIndex will be other than -1. I think SelectedIndex should be 0 even I click the arrow and don't select any item. Is there any body has same problem?
I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing
It's a bug. I have a list contains several items of Tag(int id, string name). I use "id" as ValueMember and "name" as DisplayMember. If the first item has name is an empty string, the problem will appear. When you click the arrow, seems M$ implemented to select text value to get the index. If you have an empty string, it cannot select anything and the returned index will be -1.
I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing