It's a bit complicated, but here are the highlights in the order that they occur (I just traced it to make sure there's nothing else occuring):
set DataSet/DataTable to "customer"
Load table schema, set up columns based on schema (all automatically)
control.DataBindings.Add(myproperty, customertable, myfield)
set Default property in Column in DataTable
LOOP through the above for every control (including comboboxes), then continue:
IMPORTANT_POINT_HERE:
combobox.DataSource = myfunc_returns_new_salespersontable_diff_datatable()
combobox.displaymember = "name"
combobox.valuemember = "code"
window.Show()
customer_datatable.clear()
customer_datatable.rows.add( customer_datatable.newrow() )
END
And the controls on the window do not fill out with the Defaults.
However, if I comment out the line immediately following IMPORTANT_POINT_HERE: then my controls get the default values when I add the new row to customertable.
I'm beginning to think that window.Show() has some involvement here because if I:
combobox.bindingcontext = new bindingcontext()
combobox.datasource = salespersontable
after Show() then it works! But doing this before Show() fails (controls don't get defaults).
Remember, I'm !not! trying to navigate with the combobox; also, each table sits in its own Dataset (I never have two tables in one Dataset).
I have no idea if any of this makes sense, does it? Thanks again Bonnie!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only