Why doesn't combobox.selectedindex = -1 work?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combobox called sPropertyCountyCd whose datasource is a dataview.
The first time I set the filter to the dataview, attach the combobox to the
dataview, and set the selected index to -1 is comes up correctly as blank.

However, if I change the filter, and set the selected index to -1, is always
shows the first record from the dataview and changes the index to 0. I even
tried to set the datasource to null, and then reassigning the datasource to
the dataview, but it still shows the 1st record. If I set the index to
something other than -1 (like 2), it will correctly display that item in the
combobox. I just can't get the -1 to work.

Is there another property I need to clear to prevent the combobox from
showing the first record.

Thanks for any advice,
Vern
 
Vern said:
Is there another property I need to clear to prevent the combobox from
showing the first record.

I think there is a bug in that. If you set the selectedIndex to -1 two
times in succession, it should work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top