Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value Set by Program is not Displayed in Bound TextBox

Status
Not open for further replies.

andrea96

Programmer
Jan 26, 2001
201
US
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.
Code:
txtCarrierCode.DataBindings.Add("Text", dsOrder.Tables("orders"), "routing")
5) Create the BindingManagerBase.
Code:
bmbOrders = Me.BindingContext(dsOrder, "orders")
6) Add a new row to the BindingManagerBase.
7) Set a DataRowView to the current row in the BindingManagerBase.
Code:
drvOrder = CType(bmbOrders.Current, DataRowView)
8) Fill the DataRowView with the appropriate values from the other dataset.
Code:
drvOrder("routing") = defaultRow("ship_via_code")
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.
 
I figured out what it was. I had another textbox on the same tabpage that was bound to a NULL value. It was apparently causing a problem with all of the other bound textboxes on that tabpage. It wasn't giving me an error until I went to another tabpage and then came back to this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top