Hi all
I have a datagridview with 2 columns.
fist column is Datagridview combobox the second is a datagridtextbox.
I'm trying to fill the second column based on the combobox selection .
The Method that captures the selected item does not track which row is being edited.
I have tried using the Mouse up and Cell edit events but they were unsuccessful.
This is the code that I use to capture which item has been selected.
Private Sub DGV_LinesItem_EditingControlShowing(ByVal sender As System.Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DGV_LinesItem.EditingControlShowing
Dim editingComboBox As ComboBox = e.Control
AddHandler editingComboBox.SelectedIndexChanged, AddressOf Me.editingComboBox_SelectedIndexChanged
End Sub
Private Sub editingComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If IsNumeric(CType(sender, ComboBox).SelectedValue) Then
Me.Selecteditem = CType(sender, ComboBox).SelectedIndex
End If
End Sub