Find as you type

  • Thread starter Thread starter benliu
  • Start date Start date
B

benliu

I saw in an application the ability to have a user type a part of a
name in a textbox, and as they type, a datagridview shows a list of all
customers whose name contains what is typed in the textbox. This is
all done in real-time without having to require the user to press a
search button.

How would i replicate such functionality? I assume that it's querying
a database as the user types, and requerying each time they type/delete
a character in the textbox? Or it could be that the datasource is an
object collection that it's querying from?

Any ideas? Thanks!
 
benliu said:
I saw in an application the ability to have a user type a part of a
name in a textbox, and as they type, a datagridview shows a list of all
customers whose name contains what is typed in the textbox. This is
all done in real-time without having to require the user to press a
search button.

How would i replicate such functionality? I assume that it's querying
a database as the user types, and requerying each time they type/delete
a character in the textbox? Or it could be that the datasource is an
object collection that it's querying from?

Any ideas? Thanks!

I'd say that it's probably using the TextChanged event on the TextBox
and filtering the binding source for the DataGrid with each change.
Requerying the database with each keystroke could be too performance
intensive depending on how it's done.
 
Back
Top