I have a form with textboxes bound to a dataset table. I update the textbox values with another dataset table to fill in default values. The problem is that the values are not being displayed in the textboxes. However, the value is in the dataset table that is bound to the textboxes.
Basically, these are the steps I am doing.
1) Load the blank form.
2) User types value in textbox indicating to the program this is a new record.
3) Create the dataset that will be bound to the textboxes, adding the table and columns.
4) Bind the textboxes to the dataset table.
5) Create the BindingManagerBase.
6) Add a new row to the BindingManagerBase.
7) Set a DataRowView to the current row in the BindingManagerBase.
8) Fill the DataRowView with the appropriate values from the other dataset.
9) EndCurrentEdit on the BindingManagerBase.
At this point the DataRowView and the dsOrder dataset table have the correct value, but the textbox does not. I tried Me.Refresh, but that didn’t help.
Is there something I am missing, or have done incorrectly? Any ideas would be appreciated.
Thanks.
Basically, these are the steps I am doing.
1) Load the blank form.
2) User types value in textbox indicating to the program this is a new record.
3) Create the dataset that will be bound to the textboxes, adding the table and columns.
4) Bind the textboxes to the dataset table.
Code:
txtCarrierCode.DataBindings.Add("Text", dsOrder.Tables("orders"), "routing")
Code:
bmbOrders = Me.BindingContext(dsOrder, "orders")
7) Set a DataRowView to the current row in the BindingManagerBase.
Code:
drvOrder = CType(bmbOrders.Current, DataRowView)
Code:
drvOrder("routing") = defaultRow("ship_via_code")
At this point the DataRowView and the dsOrder dataset table have the correct value, but the textbox does not. I tried Me.Refresh, but that didn’t help.
Is there something I am missing, or have done incorrectly? Any ideas would be appreciated.
Thanks.