C # How to set default value for string collection in Design

In WinForm, I have a combobox with DropDownStyle set to DropDownList (so I can not enter text). In the properties window, there is the Items property, which is a collection of rows. I enter all my values.

But now I would like to set one of these defaults (instead, to have an empty entry at runtime). I know how to do this with coding, but I'm sure (damn memory) that it was possible to set one of the values ​​in the string collection by default by adding a special character to the string.

Does anyone know what a symbol is? Or is my memory playing a trick with me, and this cannot be done through the designer?

+5
source share
2 answers

It doesn't seem like you can do this using DropDownList. From here it is suggested to set the property textto the default value that you want, but this will only work in DropDown than the DropDownList style.

+1
source

Sorry, this is not possible in the designer, because the property is Textused for this function, and this property is ignored / cleared when using DropDownList.

, , , DataBinding , DisplayMember ValueMember ComboBox . DataBinding, , , - , ?

0

All Articles