Hello,
I have a panel that is being filled with UserControls based on the Number of
Rows inside a Dataset. This works great, but when I dump the contents into
a new table it does not work the way it should. i.e.
Dim aControl As UserControl
OrderDataset.Tables("Temp").Clear()
Dim ADatarow As DataRow
For Each aControl In OrderPanel.Controls
ADatarow = OrderDataset.Tables("Temp").NewRow()
ADatarow("ItemID") = CType(aControl, OrderControl).Item
ADatarow("AssetID") = CType(aControl, OrderControl).TheIndex
ADatarow("SDescription") = CType(aControl, OrderControl).Description
ADatarow("SpaceDescription") = CType(aControl, OrderControl).Space
ADatarow("DepartmentDescription") = CType(aControl, OrderControl).Department
ADatarow("ShipTo") = CType(aControl, OrderControl).ComboShip.SelectedIndex
OrderDataset.Tables("Temp").Rows.Add(ADatarow)
Next
if there are 4 controls inside the panel four rows are placed inside table
"Temp" but Row 0 and Row 3 are always the same (but in reality they are
not). It does not matter how many rows there are the first and last are
always the same. i.e.
Row 0 ItemID = 1234
Row 1 ItemID = 5678
Row 2 ItemID = 9876
Row 3 ItemID = 1234 (but should be 3423)
What am I doing wrong?
Any Suggestions will be greatly appreciated.
Thanks,
Chuck