View Single Post
  #2 (permalink)  
Old December 17th, 2007, 01:11 PM
pencilneck pencilneck is offline
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's the code that answers my own question:
(These are unique to my app: aName, qryName, name, Name, LName, Position)

Public Class InputForm
    Dim aName As New AutoCompleteStringCollection()

Private Sub InputForm_Load(ByVal . . .
    'TODO: This line of code loads data into the NameDataSet.qryName
    'My datasource for the custom dropdown
    Me.QryNameTableAdapter.Fill(Me.NameDataSet.qryName )

    For Each name As NameDataSet.qryNameRow In Me.NameDataSet.qryName
        aName.Add(name.LName)
    Next

Private Sub PositionDataGridView_EditingControlShowing(ByVal . . .
    Dim cbo As ComboBox
    If TypeOf e.Control Is ComboBox Then
        cbo = e.Control
        cbo.DropDownStyle = ComboBoxStyle.DropDown
        cbo.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        cbo.AutoCompleteSource = AutoCompleteSource.CustomSource
        cbo.AutoCompleteCustomSource = aName
    End If

pencilneck


Reply With Quote