-1

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.?

6
Contributors
9
Replies
26
Views
9 Years
Discussion Span
Last Post by isharpk
-1

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

0

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

0

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

0

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


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

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.