Hello,
I've been trying to read the value of a combo box that resides inside a datagrid.
Here is my code so far:
*******************************
Private Sub dgSearchedItem_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgSearchedItem.EditingControlShowing
Dim editingComboBox As ComboBox = CType(e.Control, ComboBox)
If Not editingComboBox Is Nothing Then
AddHandler editingComboBox.SelectedIndexChanged, AddressOf editingComboBox_SelectedIndexChanged
End If
'RemoveHandler editingComboBox.SelectedIndexChanged, _
'New EventHandler(AddressOf editingComboBox_SelectedIndexChanged)
End Sub
Protected Sub editingComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim cboCell As ComboBox = CType(sender, ComboBox)
If cboCell.SelectedValue = "D" Then
MessageBox.Show(cboCell.Text) ' Display value
End If
*****************************
In the code above where it says "Handles dgSearchedItem.EditingControlShowing", i keep getting a message "EditingControl Showing" cannot be found, and the line is underlined.
However, the code above seems to be working for some other users that i have seen on the web.
Any help will be appreciated.
Thank you.