'These Classes are used by the AddDataGridStyle Routine... Public Class MyClsDataGridComboBoxColumn Inherits DataGridTextBoxColumn Public MyCombo As MyClsDataGridComboBox Private m_isEditing As Boolean Public Sub New() MyBase.New() MyCombo = New MyClsDataGridComboBox() m_isEditing = False AddHandler MyCombo.Leave, New EventHandler(AddressOf LeaveComboBox) AddHandler MyCombo.SelectionChangeCommitted, New EventHandler(AddressOf OnSelectionChangeCommitted) End Sub Protected Overloads Overrides Sub Edit(ByVal source As CurrencyManager, ByVal rowNum As Integer, ByVal bounds As Rectangle, ByVal readOnly1 As Boolean, ByVal instantText As String, ByVal cellIsVisible As Boolean) MyBase.Edit(source, rowNum, bounds, readOnly1, instantText, cellIsVisible) MyCombo.Parent = Me.TextBox.Parent MyCombo.Location = Me.TextBox.Location MyCombo.Size = New Size(Me.TextBox.Size.Width, MyCombo.Size.Height) MyCombo.Text = Me.TextBox.Text Me.TextBox.Visible = False MyCombo.Visible = True MyCombo.BringToFront() MyCombo.Focus() End Sub Private Sub LeaveComboBox(ByVal sender As Object, ByVal e As EventArgs) MyCombo.Hide() End Sub Protected Overloads Overrides Function Commit(ByVal dataSource As CurrencyManager, ByVal rowNum As Integer) As Boolean If m_isEditing Then m_isEditing = False SetColumnValueAtRow(dataSource, rowNum, MyCombo.Text) End If Return True End Function Private Sub OnSelectionChangeCommitted(ByVal sender As Object, ByVal e As EventArgs) m_isEditing = True MyBase.ColumnStartedEditing(sender) End Sub End Class Public Class MyClsDataGridComboBox Inherits ComboBox Private WM_KEYUP As Integer = &H101 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If m.Msg = WM_KEYUP Then Return End If MyBase.WndProc(m) End Sub End Class