Whenever I try to have code execute during the selectedindexchanged event of my combobox on the datagridview cell, the cell refuses to update itself or the related objects properly.
I have a feeling the issue surrounds the endedit, beginedit, acceptchanges, and those other properties, however I have not come across much useful information about using them in a practical sense. I'm also not sure on the exact ordering/protocol for using them, assuming they may be a cause for these problems.
Anyways, here is some code that I'm referring to:
Notice the call to "costsntax", which executes fine if I click a button calling that sub, but when used in the selectedindexchanged event, does not perform correctly.
Ideas?
I have a feeling the issue surrounds the endedit, beginedit, acceptchanges, and those other properties, however I have not come across much useful information about using them in a practical sense. I'm also not sure on the exact ordering/protocol for using them, assuming they may be a cause for these problems.
Anyways, here is some code that I'm referring to:
Notice the call to "costsntax", which executes fine if I click a button calling that sub, but when used in the selectedindexchanged event, does not perform correctly.
Ideas?
Code:
Public Sub dataGridView3_EditingControlShowing(ByVal sender As Object, _
ByVal e As DataGridViewEditingControlShowingEventArgs) _
Handles DataGridView3.EditingControlShowing
If DataGridView3.CurrentRow.Cells(1).Selected Then
Dim comboBoxtemp3 As New ComboBox
comboBoxtemp3 = CType(e.Control, ComboBox)
If (comboBoxtemp3 IsNot Nothing) Then
RemoveHandler comboBoxtemp3.SelectedIndexChanged, New EventHandler(AddressOf ComboBox3_SelectedIndexChanged)
AddHandler comboBoxtemp3.SelectedIndexChanged, New EventHandler(AddressOf ComboBox3_SelectedIndexChanged)
End If
End If
End Sub
Public Sub ComboBox3_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
costsntax()
End Sub