combobox.SelectedIndex = -1 problem

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I am trying to simply display/select information from a
combo box filled with table information. This presents
no problem until I have a null field. I check for Null
values in input table/columns and if present I do not
want to have combo box display anything. I have tried:
combobox.SelectedIndex = -1 but the Selected Index does
not change to -1. The combo box is bound to nothing;
DataSource/DisplayMember property = dataset that filled
combo box; ValueMember = control column in dataset that
filled combo box. I'm sure this is a rookie kind of
problem ... but would appreicate some advice ... thanks!
Dave
 
I too have the same problem. I have read the microsoft article and still
does not fix the problem. I tried to first two resolutions but not the
third because I want to databind. Is there another way around this isssue?

Thanks
 
Omkumar,
Thanks for pointing me to the knowledge base article ..
problem is the work arounds don't work in my
application. At least I can quit pulling my hair out ...
and see if microsoft has a resolution to this bug ... I'm
running .Net Framework 1.1 ... article refers to 1.0 ...
which you would think would be better not worse.
Thanks again.
Dave
 
I am running 1.1 and i did have that problem. but setting the selectedindex
to -1 twice, solved the problem for me. however my code looks ugly :(
 
* "Dave said:
I am trying to simply display/select information from a
combo box filled with table information. This presents
no problem until I have a null field. I check for Null
values in input table/columns and if present I do not
want to have combo box display anything. I have tried:
combobox.SelectedIndex = -1 but the Selected Index does
not change to -1. The combo box is bound to nothing;
DataSource/DisplayMember property = dataset that filled
combo box; ValueMember = control column in dataset that
filled combo box.

This is a bug, see:

<http://support.microsoft.com/default.aspx?scid=kb;en-us;327244>
 
Back
Top