Hi all, problem with binding...
I have a "Detail" form with.. say 5 controls with buttons for add/edit/save/cancel/exit.
I have a second "Find" form used to find a record from a back-end datasource. I get the selected record's ID and call the "Detail" form.
The "Detail" form dynamically does the binding via textboxSample.DataBindings.Add( "Text", MyDataTable, "MyField" ) for respective fields 1-5.
All data shows no problem. I click EDIT on the "Detail" form, change the data, then save, I look at the data record and all the changes are there, and they get pushed to the back-end as expected.
Now, the problem. If I start with the "Detail" form, I STILL pre-query a MyDataTable object from its source so I have the known structure and columns, but no records. I continue to add a new record via...
MyDataTable.Rows.Add( MyTable.NewRow())
so I'm sure of getting same structure of existing table and have a "place-holder" for the new data record to have populated.
The form then does the binding exactly as it does when called from the "Find" form, and blank values are displayed for new entry. I then fill in the data to the textbox controls.
When I click the save button, and look at MyDataTable.Rows[0][MyField1] (fields 1-5), they are all blank in the record, but actually have values on the form.
Hopefully its something obscure vs something stupid. Thanks... My forehead is starting to get flat from hitting against the wall