Hi Everyone,
I am having trouble with textbox autocomplete in my datagridview control. What I want to happen here is to enable the autocomplete in datagridview column 1 only and the rest columns (2,3, so on, so forth), autocomplete feature should be disabled. The autocomplete works fine when I tested it, but unfortunately, when the autocomplete was triggered from the specified column (column 1), it also worked with the other column cells as if the auto complete is available to all the cells in datagridview even if I specified in my validation is columnIndex = 1 only... I want the textbox autocomplete disabled to col2,3, so on, so forth cells. Please help me out guys.
Below is the code I used in my datagridview_EditingControlShowing event:
Private Sub dgvPOItems_EditingControlShowing(sender As Object, e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgvPOItems.EditingControlShowing
Dim TX As TextBox = CType(e.Control, TextBox)
If dgvPOItems.CurrentCell.ColumnIndex = 1 Then
If Not IsNothing(TX) Then
TX.AutoCompleteCustomSource = gacInventoryItemsLookUp
TX.AutoCompleteMode = AutoCompleteMode.SuggestAppend
TX.AutoCompleteSource = AutoCompleteSource.CustomSource
End If
Else
TX = Nothing
End If
End Sub
End If
Note: gacInventoryItemsLookUp is supplied upon program initialization.
Thanks,