I have this test form where I'm testing the idea, but ran into a snag.
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:
Dim dt As DataTable Dim dsNewDataset As New DataSet() Dim i = 0, intSetArray As Integer = 0 Public Function JT_PullDataWithCOLUMNS1(ByVal Cols As String, ByVal TableName As String) As DataTable If dsNewDataset.Tables.Count >= 1 Then dsNewDataset.Clear() intSetArray = 0 i = 0 End If Dim conn As String = "Server=192.132.0.53;Port=3306;Database=wic;Uid=root;Pwd=12sw" Dim cmd As String = "SELECT " & Cols & " FROM " & TableName Dim ad As New MySql.Data.MySqlClient.MySqlDataAdapter(cmd, conn) ad.GetFillParameters() ad.Fill(dsNewDataset) dt = dsNewDataset.Tables(0) JT_PullDataWithCOLUMNS1 = dsNewDataset.Tables(0) End Function Private Sub InsertUserList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim aa As DataSet = JT_PassDataSet 'DGV.DataSource = Call JT_PullDataWithCOLUMNS1("PASSWORD", "st_users") Dim comboboxcol As DataGridViewComboBoxColumn = Me.DGV.Columns("PASSWORD") comboboxcol.DataSource = dt comboboxcol.DisplayMember = "PASSWORD" comboboxcol.ValueMember = "PASSWORD" comboboxcol.ReadOnly = False End Sub




Reply With Quote
