Bind the datasource in the normal way, set the Selected index to -1 THEN
subscribe the eventhandler to the SelectedIndexChanged event (or whichever
event you are using):
combobox.DataSource = MyDataSource;
combobox.DisplayMember = "aaa";
combobox.ValueMember = "aaa";
combobox.SelectedIndex = -1;
combobox.SelectedIndexChanged += new
EventHandler(combobox_SelectedIndexChanged);
"progressdll" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to change the behaviour of setting the DataSource property
> of combobox.
>
> Here is the behaviour I now see.
>
> Setting the DataSource property of combobox to an ArrayList will visual
> display
> the first value in the Text field of the combobox. ( or setting the
> Text property ).
>
> I don't want this to happen. Just load the DataSource, don't change the
> Text property.
>
> Any Ideas
>
|