0

I have a problem that I can't solve, I have a comboBox that have items from a SQL database, let's say it have the items: "Lolo", "123loma", "lo789"

What I need is, when I write "lo" the droppedDown list should show me the three items, like in a standard autocomplete.

Please help me!

edit: Hello! @jimi thanks for the reply, I tried what you said, but didn't work perhaps I am doing something wrong, here is what I have done:

Private Sub cboActividad_TextChanged(sender As Object, e As EventArgs)
Handles cboActividad.TextChanged

        TempTable = cboActividad.DataSource
        Dim TempList As New AutoCompleteStringCollection
        For Each row As DataRow In From row2 As DataRow In TempTable.Rows Where (row1("titulo").Contains(sender.Text))
            TempList.Add(row(1).ToString())
        Next

        cboActividad.AutoCompleteCustomSource = TempList
    End If

End Sub

I already have the "cboActividad" AutoCompleteSource = CustomSource. If you need something else to make it clearer tell me. Thanks!

Gero92
  • 11
  • 1
  • You'll have to build your own Comparer method, derive a `List(Of [Items that match])`, use this List to fill the `AutoCompleteCustomSource`. – Jimi Nov 12 '18 at 14:23
  • Hi! @Jimi I've just update my situation please tell me if you know whats happening. – Gero92 Nov 13 '18 at 12:38
  • You are far away here. See these examples and, if you have a hard time implementing them, post other, more specific questions. [AutoComplete1](https://stackoverflow.com/questions/796195/c-sharp-autocomplete?answertab=active#tab-top). [AutoComplete2](https://stackoverflow.com/a/13892238/7444103). [AutoComplete3](https://gist.github.com/voquanghoa/cad023a3f93b1eb6f0ffcb0948bd9b4e). I'm not sure whether there are samples around in VB.Net. Get the hang of it, then post back. – Jimi Nov 13 '18 at 16:03

0 Answers0