Searching database with partial name
Is there a way to search through a listview using only part of a search name?
For example, if you have a list of cars like "Honda Civic", "Honda Accord", etc.; how can you just type in Honda and have all the Honda results show while all the Toyota, Mazdas, etc. don't show?
Re: Searching database with partial name
There's no way to specifically filter a ListView. To "filter" the data you basically have to remove the items you don't want to display. Not ideal.
vb.net Code:
Dim item As ListViewItem
For index As Integer = myListView.Items.Count -1 To 0 Step -1
If myListView.Items(index).Text.Contains("Honda") Then
myListView.Items.RemoveAt(index)
End If
Next
A better option would be to bind data to a DataGridView via a BindingSource. Then you can genuinely filter the data.
Re: Searching database with partial name
your code worked perfectly ... and if I knew how to do the other thing you suggested I would (luckily this is just for a demo to get tester feedback) ... thank you again