Aaron,
It seems for me as if the Google newsgroup are a mash as well,
I thought that this one is the simple comboboxcolumn that is as well as
sample on syncfusion a little bit changed by me to let it go as well with
option strict on.
\\\
Public Class DgComboBoxColumn
Inherits DataGridTextBoxColumn
Public WithEvents ColumnComboBox As DataGridCombo 'special class
Private WithEvents cmSource As CurrencyManager
Private mRowNum As Integer
Private isEditing As Boolean
Shared Sub New()
End Sub
Public Sub New()
MyBase.New()
ColumnComboBox = New DataGridCombo
AddHandler ColumnComboBox.SelectionChangeCommitted, _
New EventHandler(AddressOf ComboStartEditing)
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)
mRowNum = rowNum
cmSource = source
ColumnComboBox.Parent = Me.TextBox.Parent
ColumnComboBox.Location = Me.TextBox.Location
ColumnComboBox.Size = New Size(Me.TextBox.Size.Width,
ColumnComboBox.Size.Height)
ColumnComboBox.Text = Me.TextBox.Text
TextBox.Visible = False
ColumnComboBox.Visible = True
ColumnComboBox.BringToFront()
ColumnComboBox.Focus()
End Sub
Protected Overloads Overrides Function Commit(ByVal dataSource As _
CurrencyManager, ByVal rowNum As Integer) As Boolean
If isEditing Then
isEditing = False
SetColumnValueAtRow(dataSource, rowNum, ColumnComboBox.Text)
End If
Return True
End Function
Private Sub ComboStartEditing(ByVal sender As Object, ByVal e As
EventArgs)
isEditing = True
MyBase.ColumnStartedEditing(DirectCast(sender, Control))
End Sub
Private Sub LeaveComboBox(ByVal sender As Object, ByVal e As EventArgs)
_
Handles ColumnComboBox.Leave
If isEditing Then
SetColumnValueAtRow(cmSource, mRowNum, ColumnComboBox.Text)
isEditing = False
Invalidate()
End If
ColumnComboBox.Hide()
End Sub
End Class
This one is when you want to use valuemembers, I made it as well from a
sample that is as well on syncfusion and changed as well some parts and in
that thread was an improvement again by the original poster. The thread was
longer however that improvement is gone. However you can try this one when
you need that valuemember otherwise I would when I was you try the first
one.
http://tinyurl.com/49p35
This link is another datagrid faq page
http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/datagrid.mspx
Give it a try, I hope this helps?
Cor.