I have this test form where I'm testing the idea, but ran into a snag.

Name:  uuuuu.JPG
Views: 246
Size:  11.9 KB

Now the main idea is to load all the data from a dataset into the one column of the datagridview. This works perfectly as shown in the image.

Now there is something that I want to happen, but just can't get it right.

when on the DataGridViewComboBox Column I also want to be able to type in my own data if the one I want is not available in the combobox.

Also if there are 50 values in my combobox and 2 of them are:

jacky, jacson

When i type jac
I want the combobox to only give me the options starting with "jac"

Here is the code that I'm currently using:

3 Code:
  1. Dim dt As DataTable
  2.     Dim dsNewDataset As New DataSet()
  3.     Dim i = 0, intSetArray As Integer = 0
  4.  
  5. Public Function JT_PullDataWithCOLUMNS1(ByVal Cols As String, ByVal TableName As String) As DataTable
  6.         If dsNewDataset.Tables.Count >= 1 Then
  7.             dsNewDataset.Clear()
  8.             intSetArray = 0
  9.             i = 0
  10.         End If
  11.         Dim conn As String = "Server=192.132.0.53;Port=3306;Database=wic;Uid=root;Pwd=12sw"
  12.         Dim cmd As String = "SELECT " & Cols & " FROM " & TableName
  13.         Dim ad As New MySql.Data.MySqlClient.MySqlDataAdapter(cmd, conn)
  14.  
  15.         ad.GetFillParameters()
  16.         ad.Fill(dsNewDataset)
  17.  
  18.         dt = dsNewDataset.Tables(0)
  19.  
  20.         JT_PullDataWithCOLUMNS1 = dsNewDataset.Tables(0)
  21. End Function
  22.  
  23.  
  24.  
  25. Private Sub InsertUserList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  26.         Dim aa As DataSet = JT_PassDataSet
  27.         'DGV.DataSource =
  28.         Call JT_PullDataWithCOLUMNS1("PASSWORD", "st_users")
  29.  
  30.         Dim comboboxcol As DataGridViewComboBoxColumn = Me.DGV.Columns("PASSWORD")
  31.         comboboxcol.DataSource = dt
  32.         comboboxcol.DisplayMember = "PASSWORD"
  33.         comboboxcol.ValueMember = "PASSWORD"
  34.         comboboxcol.ReadOnly = False
  35. End Sub