I told you already, calcWhatif doesn't do anything yet. I haven't put
any code in it other than this:
Private Sub calcWhatif(ByRef sColumn As String, ByRef iRow As String)
Dim dr As DataRow
Dim drW As DataRow
Dim ProdPos As ProductPosition 'a small defined class object
Static i As Integer = 0
i += 1
Debug.WriteLine("calcWhatif " & i)
End Sub
I added the debug piece to help me see what was going on.
The handler is as follows:
Private Sub Whatif_Changed(ByVal sender As Object, ByVal e As
DataColumnChangeEventArgs)
Static i As Integer = 0
i += 1
Debug.WriteLine("This is cycle number " & i)
calcWhatif(e.Column.ColumnName, e.Row.Item(0))
Debug.WriteLine("Column " & e.Column.Ordinal)
End Sub
So, right now the handler is calling an empty function that just returns
after outputting the debug info. The problem is that the handler is
being called again before returniing from calcWhatif to run the second
debug line. I never get to see the column ordinal displayed.
But if I take out the call to calcWhatif, everything is fine - I see the
ordinal value and the handler runs once. This handler has to be able to
call another function, because I have to run calculations based on the
changed value.
Any insight?
Tom
Bob Powell [MVP] wrote:
This wouldn't cause a stack overflow. Just the efficient eating up of 100%
of the processor. It sounds to me as if CalcWhatIf calls CalcWhatIf
internally and is causing a recursive problem.
If however the OP refuses to post the actual code instead of being all coy
about the content of his method then there's not a whole lot we can do ;-)