I'm getting a stackoverflow trying to add one row to a datatable bound to a WPF datagrid.
Code:
Private Sub Fill_XXX_Datagrid(sFillSQL As String)
Dim Management = New DatabaseManagement()
dgXXX.ItemsSource = Management.LoadXXXData(sSQL).DefaultView
' Add a TableNewRow event handler. Put the RWTII # in the new row.
AddHandler dt.TableNewRow, New _
DataTableNewRowEventHandler(AddressOf NewXXX)
End Sub
Private Sub NewXXX()
Dim row As DataRow = dt.NewRow()
row("zzz") = zzz
dt.Rows.Add(row)
End Sub
Overflow happens on "Dim row as DataRow = dt.NewRow(). A breakpoint on this line shows that the datatable has one row, which is what I expect since there is an existing row. This line causes an endless loop for whatever reason.
Thanks.
Kris Hood