Imports System.Windows.Forms.DataGridView Namespace System.Windows.Forms Public Class DataGridViewNew Inherits DataGridView Private WithEvents Test As ComboBox Private LastColIndex As Int32 Private LastRowIndex As Int32 Private Sub DGV_Validate(ByVal sender As Object, ByVal e As DataGridViewCellValidatingEventArgs) Handles MyBase.CellValidating If TypeOf (Me.Columns(e.ColumnIndex)) Is DataGridViewComboBoxColumn Then Dim comboBoxColumn As DataGridViewComboBoxColumn = CType(Me.Columns(e.ColumnIndex), DataGridViewComboBoxColumn) If (Not comboBoxColumn.Items.Contains(e.FormattedValue)) Then comboBoxColumn.Items.Add(e.FormattedValue) Me.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = comboBoxColumn.Items(comboBoxColumn.Items.Count - 1) End If End If End Sub Private Sub DGV_EditShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles MyBase.EditingControlShowing If TypeOf (MyBase.Columns(MyBase.CurrentCell.ColumnIndex)) Is DataGridViewComboBoxColumn Then Test = CType(e.Control, ComboBox) If (Test IsNot Nothing) Then Test.DropDownStyle = ComboBoxStyle.DropDown LastColIndex = MyBase.CurrentCell.ColumnIndex LastRowIndex = MyBase.CurrentCell.RowIndex End If End If End Sub Private Sub Test_Leave(ByVal sender As Object, ByVal e As EventArgs) Handles Test.Leave If TypeOf (Me.Columns(LastColIndex)) Is DataGridViewComboBoxColumn Then Dim comboBoxColumn As DataGridViewComboBoxColumn = CType(Me.Columns(LastColIndex), DataGridViewComboBoxColumn) Dim comboCell As DataGridViewComboBoxCell = CType(Me.Rows(LastRowIndex).Cells(LastColIndex), DataGridViewComboBoxCell) Test.SelectAll() If Len(CStr(Test.SelectedText)) > 0 Then If Not comboBoxColumn.Items.Contains(Test.SelectedText) Then comboBoxColumn.Items.Add(Test.SelectedText) comboCell.Value = comboBoxColumn.Items(comboBoxColumn.Items.Count - 1) End If End If End If End Sub End Class End Namespace