Setting first field in a combo box to null

user765942 picture user765942 · Oct 1, 2011 · Viewed 18.3k times · Source

I have a databound ComboBox on my form. Is there any way that I can make the first field blank.

I can do this with a DropDownList in the HTML part of .Net but is there a way to do it for a ComboBox?

Thanks

Answer

Kristian Benning picture Kristian Benning · Mar 18, 2013
ComboBox1.SelectedValue = -1 

didn't work for me but this did:

ComboBox1.SelectedIndex = -1 

I would have though -1 would have been an invalid index value, but obviously not.

Kristian