Combobox with many values

  • Thread starter Thread starter Becker
  • Start date Start date
B

Becker

I have a need for a simple combobox on a form in one of my programs that
represents city, state. I want to have it autocomplete as the user types.
I have a table with these values (about 50k of them) and I'd like to source
it from there.

I have seen some methods out there for the autocomplete, but I think that
pulling 50k in the combobox might be too slow at runtime to build a table of
all those records and then bind the entire combobox to the 50k source. It
is ok that they type a character or two and then it dynamically build a
combobox and start the autocomplete process.

What is the recommended method of doing something like this? Is 50k records
for a combobox source excessive? How have others gotten around this
efficiently?

Thanks,
Ben
 
Becker,

Assuming you are from the US than I would recomend two comboboxes one with
state and one with citys which you load dynamicly depending on the state.

This is by the way in my opinion the most used sample when you google for
that.

I hope this helps?

Cor
 
You can use filtering to reduce as much as possible the number of items in
the city combobox. For example, you can have 2 comboboxes, one for states
and other for cities of the selected state in the first combobox. When the
state selected changes, the combo with cities is filled.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
Back
Top