Visual Basic.Net:

I have a DataGridView in Last Name sequence.
Is it possible to when a user types the first letter of a last name
that it displays all rows with last names that start with that letter.
When he types the second letter, it displays all records whose last name starts with those 2 letters, etc.?

This is pretty much doable and this functionality is called AutoComplete is Web Platform and Incremental Search in WinForms Arena.

It works great!!!
Below is the code that I ended up with:

If LastNameTextBox.TextLength > 0 Then
PatientBindingSource.Filter = String.Format("LastName Like '" & LastNameTextBox.Text) & "*'"
Else
PatientBindingSource.Filter = String.Empty
End If

Private Sub LastNameTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LastNameTextBox.TextChanged

hi, there.. i try used your code, but it doesn't help...


If LastNameTextBox.TextLength > 0 Then
PatientBindingSource.Filter = String.Format(

Use % sign on both side of given string.

If LastNameTextBox.TextLength > 0 Then
PatientBindingSource.Filter = String.Format("LastName Like '%" & LastNameTextBox.Text) & "%'"
Else
PatientBindingSource.Filter = String.Empty
End If
This question has already been answered. Start a new discussion instead.