Re: Is there an alternative to a combobox for selecting -- VB2005?
- From: Larry Dodd <LarryDodd@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Jan 2007 20:22:00 -0800
Check into using a DataView on the Dataset. You can set the RowFilter
property to something like "CompName LIKE '" & ComboBox.Text.ToString & "*'"
Since you said that the dataset is populated very quickly this will give you
a subset of the DataTable without having to go back to the server. It will
only show you a portion of the DataTable. If you put this in the TextChanged
event the DataView will be refreshed with each letter even if the user
deletes a letter or something like that.
"jeff" wrote:
.
if you do this ... be careful not to create a lot of round trips to the
server...or a delay between the user entering a letter...
person enters SIM ...
delay after S to retrieve data and populate the combo box...
delay after I to retrieve data and populate the combo box... do not need to
retrieve ...S will have already populated cb with necessary records...
delay after M to retrieve data and populate the combo box ... do not need
this retrieve ... S will have already populated cb with necessary records...
person, clicks on the S and deletes it ... so ... not they have IM
delay ... combo box needs to retrieve and populate list...
user deletes M ... delay ... combo box needs to retrieve and populate
list...
you see where this is going ... you will be causing delay for the user and
you will have alot of round trips to the server.
plus, you will have to capture if the first letter the user entered has
changed ... causing your list to 'refilter'
The round trips are easy ... retrieve all the data for the list and cache it
in-memory...
The time will be 'purging the combo list' and 'refilling it'... this will
cause a delay ... the user will be typing and will not see anything...until
your have populated, purged, populated, purged, populated the combo box
value list.
I would recommend a timer event ... wait for a delay ... popup window ...
that 'looks' like a combo box.
Jeff.
"Rich" <Rich@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2242428B-6BF4-429E-9113-D5D58A781E6A@xxxxxxxxxxxxxxxx
Thank you all for your replies. I did think about the subset idea. The
issue is with the Autocomplete feature. My users don't scroll. They let
the
name autocomplete. I can achieve the autocomplete feature nicely if I
pull
all 30,000 names. My main thing was to check first to make sure I am not
going to reinvent the wheel by coming up with another solution I had in
mind.
So it looks like implementing my other solution might not be reinventing
the
wheel.
The user types a letter. On the key up stroke I pull data from the server
for all names that start with that letter and set the combobox datasource
to
that list and then do the drop down thing. Well, I will give something
like
that a try.
Thanks again all for your replies.
Rich
"Rich" wrote:
Greetings,
I have to load 30,000 unique names into a combox. Filling a dataTable
takes
only a few milliseconds. But populating the combobox and displaying the
list
takes several seconds - way too long. A user selects a name from the
combobox and runs a query.
Originally, this combox was on a form in an MS Access ADP which was
linked
directly to our sql server. The combobox populated withins millisecnods.
How can I achieve this kind of performance in my VB2005 app? what is the
bottle neck here?
Thanks,
Rich
- References:
- Prev by Date: 'Faking' input to QBasic program with VB .NET 2005 application
- Next by Date: Re: Deploying VB 2005 applications via .MSI?
- Previous by thread: Re: Is there an alternative to a combobox for selecting -- VB2005?
- Next by thread: Problem with KeyDown() method not executing
- Index(es):
Relevant Pages
|