ComboBox

  • Thread starter Thread starter Rob Thomson
  • Start date Start date
R

Rob Thomson

Environment c#, CF 1.1

Hi does anyone know how to search a databound combobox. I am editing data,
and want to select a combo boxes value on the basis of the edit, standardly
this would be done with Combo.FindStringExact, but that doesnt exist. I
really dont want to loop around all the values in the combo looking for the
value, is there a cleaner way, I guess all the winapi calls are out of the
window too...

Thanks
 
Looping might be pretty bad.
Really depends on the size. Even for data-bound combobox get_Item actually translates into SendMessage(CB_GETSTRING). Those, multiplied by 200-300 items are going to take a very sizable chunk of time
 
Looping is not bad as in not *hard* to code. Even on the perf-front, I use
it for finding strings in my apps and there is no visible penalty, so I
recommend it.

Now if you are adding 200-300 items that might be a different story; if I am
ever forced (with a knife) to do that I will check out your sample :-)

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Looping might be pretty bad.
Really depends on the size. Even for data-bound combobox get_Item actually
translates into SendMessage(CB_GETSTRING). Those, multiplied by 200-300
items are going to take a very sizable chunk of time
 
And if you've got 200-300 items in you combobox I'd argue that search times
aren't your major problem.

-Chris
 
Gentlemen, I think you are too harsh on me. What's wrong with 200-300 records in a combo? 2000 - yes kinda bad, but 200 is totally manageable. It's about 7 screen sizes at 8pt
 
Back
Top