Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim tb As New TextBox
- Dim dt As New DataTable
- If DataGridView1.CurrentCell.ColumnIndex = 2 Then
- If con.State = ConnectionState.Closed Then con.Open()
- cmd = New SqlCeCommand("Select name FROM items where name like '%" & DataGridView1.CurrentCell.Value & "%'", con)
- Dim da As New SqlCeDataAdapter
- da.SelectCommand = cmd
- da.Fill(dt)
- Dim r As DataRow
- For Each r In dt.Rows
- If TypeOf e.Control Is TextBox Then
- If DataGridView1.CurrentCell.ColumnIndex = 2 Then
- tb = e.Control
- tb.AutoCompleteCustomSource.Add(r.Item("name").ToString)
- tb.AutoCompleteMode = AutoCompleteMode.Suggest
- tb.AutoCompleteSource = AutoCompleteSource.CustomSource
- End If
- End If
- Next
- da.Dispose()
- cmd.Dispose()
- dt.Dispose()
- con.Close()
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement