Click to See Complete Forum and Search --> : Findstring and a Datagridview


jcb1269
03-20-2007, 04:05 PM
Is there a way to find a string in a datagridview column? I'm allowing the user to search by typing in a textbox and I want the grid to display the data it finds as the user types. Can this be done with a datagridview?

Thanks all.

jb

jellyfish5000
03-20-2007, 05:19 PM
Have a look at the DataView RowFilter.
I stumbled across this today.
A snippet of the code I'm using is:

Dim dv As New DataView(tblNewExchangeRatesTable)
dv.RowFilter = "Country = 'EUROPEAN COMMUNITY (EU)'"

jcb1269
03-21-2007, 11:36 AM
What I'm needing to do is, as the user types in the search textbox, the reocord in the grid is highlighted. So the user could put in a D, so the first record with a D is highlighted, then they put an A and this first record with a DA appears. How would I make this happen?

Sorry if I seem to be dumbing it down, no offense to anyone...

Thank you in advance...

jb

jcb1269
03-21-2007, 12:40 PM
I figured it out. I'm querying the database for the value of the textbox after each char in entered. This works great.

Thanks all.