Problem coding for DataGridViewComboBox selection

Reaction

Member
Joined
Apr 29, 2007
Messages
13
Programming Experience
1-3
How do you retrieve the current cell row index and column index when using the DataGridView control's EditingControlShowing event?

I have the code below but it seems my compiler is having issues with these highlighted lines, anyone know what I can do to solve this?


Private Sub DataGridView1_EditingControlShowing1(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing

Dim cb As new DataGridViewComboBoxColumn = Datagridview1.columns("DESCRIPTION")
If (cb IsNot Nothing) Then

' first remove event handler to keep from attaching multiple:
cb.SelectedIndexChanged -= New EventHandler(cb_SelectedIndexChanged)
' now attach the event handler
cb.SelectedIndexChanged += New EventHandler(cb_SelectedIndexChanged)
End If

End Sub


Reaction
 
Back
Top