Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autosearch Datagridview

Status
Not open for further replies.

RBSTR

Programmer
Nov 10, 2005
71
GB
Hi

I am making my first amendment to a VB2005 project.

I have a datagridview with read only columns bound to a dataset.

It displays customer codes and names.

I want to capture the user's keypresses when the grid is selected and navigate to highlight the first row that matches the customer code against the value keyed by the user.

For example I have a list of codes

AAA01
AAB02
AAB03
BOB02

So if the user keys in 'AAB' then 'AAB02' would be selected. if the user keys 'AAB' again then 'AAB03' would be selected.

I had done something similar in VB6 by using a timer to catch when it appears the user may have stopped keying and then search the rows for matching data against the string collected from the user's keypresses.

I wonder whether there is a better way of doing this in VB2005?

Many thanks in advance
 
I would try calling your search code after each keypress. So if the user types "a", filter to everything which begins with an a. If the user then types a "c", filter by items which begin with "ac." It should be manageable since all of your data resides in-memory with your app.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top