views:

196

answers:

1

Hi,

I got a combobox which is filled with values from datasource. By default the first value is chosen which is fine but I need to display "Choose country" as the default combobox text. The user then can choose from the drop down list.

The reason is when the first value from datasource is chosen as the default value the rest of the form field are automatically filled(implemented in selectindexchange method) but I need the form to be empty on load and diplay "Choose country" as Combobox text.

How to do that?

I have my combobox filled

CountryDetailsBindingSource.DataSource = CountryCtrl.GetCountryDetails(Id)//this returns an array
 Me.SelectCountry.DataSource = Me.CountryListBindingSource
 Me.SelectCountry.DisplayMember = "CountryName"
 Me.SelectCountry.ValueMember = "ID"

Any help is appreciated .

Thanks in advance

A: 

I think it might work if you insert a new value at the start of the array, giving it the CountryName "Choose Country" and ID -1.

ho1
Well for now I have done SelectIndex = -1. that seemed easy.
fireBand