Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding + Controls
Message
 
À
14/02/2008 16:08:56
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01292720
Message ID:
01292796
Vues:
26
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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform