BindingManagerBase issue
I have a strange problem in using databinding - i wonder if anyone can help.
Briefly - i have a class with a dataset and all associated code to update the DS.
The UI form gets a reference to the DS and controls are bound to the fields in the DS.
When i add a new record i do the following
Note: i'm using a strongly typed datset)
m_Bmb.EndCurrentEdit()
DTOrders = OrderDS.Orders
Debug.WriteLine("Before Add: " & DTOrders.Rows.Count.ToString)
'Create new row with same schema...
DR = DTOrders.NewOrdersRow
DR.CustomerID = "XXX" 'Dummy value
DR.EmployeeID = 1 'Dummy value
'???
Debug.Write("OID::" & DR.OrderID.ToString & vbCr)
DTOrders.AddOrdersRow(DR)
Debug.WriteLine("Afer Add: " & DTOrders.Rows.Count.ToString)
m_Bmb.Position = m_Bmb.Count - 1
ClearFields()
For some reason "m_Bmb.Position" doesn't advance to the last record of the DS - the newly added record. It doesn't change value. Any idea why...
Thanks for any help in advance
I have a strange problem in using databinding - i wonder if anyone can help.
Briefly - i have a class with a dataset and all associated code to update the DS.
The UI form gets a reference to the DS and controls are bound to the fields in the DS.
When i add a new record i do the following
m_Bmb.EndCurrentEdit()
DTOrders = OrderDS.Orders
Debug.WriteLine("Before Add: " & DTOrders.Rows.Count.ToString)
'Create new row with same schema...
DR = DTOrders.NewOrdersRow
DR.CustomerID = "XXX" 'Dummy value
DR.EmployeeID = 1 'Dummy value
'???
Debug.Write("OID::" & DR.OrderID.ToString & vbCr)
DTOrders.AddOrdersRow(DR)
Debug.WriteLine("Afer Add: " & DTOrders.Rows.Count.ToString)
m_Bmb.Position = m_Bmb.Count - 1
ClearFields()
For some reason "m_Bmb.Position" doesn't advance to the last record of the DS - the newly added record. It doesn't change value. Any idea why...
Thanks for any help in advance