I'm using the Binding source in my winform C# application.
I had no problems with other Forms and Tables.
But now i can't solve my problem:
My Binding is :
BindingSource BS_ART = new BindingSource(Parametres.DS_GESPI, "ARTs");
the BS_ART.CancelEdit() doesn't work after the controls bindings. When I test it before the Create Void, it's well working. But I' can't understand.
The bindings to my controls is:
I'm using a usercontrol named TextBoxCalcul where there is into it a TextBox named TEXTBOX_AVEC_CALCULATRICE.
private void CreateBindingsART()
{
FarttxtID.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_ART"].ToString()));
FarttxtCODE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["CODE_ART"].ToString()));
FarttxtDESIGNATION.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["DESIGNATION_ART"].ToString()));
FarttxtREF_FOURNISSEUR.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["REF_FOURNISSEUR_ART"].ToString()));
FarttxtPAQUET.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["PAQUET_ART"].ToString()));
FarttxtCOMMENTAIRES.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["COMMENTAIRES_ART"].ToString()));
FarttxtDOUANE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["DOUANE_ART"].ToString()));
FarttxtPRIX_ACHAT.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["PRIX_ACHAT_ART"].ToString()));
FarttxtV1.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["CONSOMMATION_AN_ART"].ToString()));
FarttxtV2.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["COUT_COMMANDE_ART"].ToString()));
FarttxtV3.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["PRIX_ACHAT_ART"].ToString()));
FarttxtV4.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["COUT_POSSESSION_ART"].ToString()));
FarttxtV5.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["DELAI_ART"].ToString()));
FarttxtV6.TEXTBOX_AVEC_CALULATRICE.DataBindings.Add(new Binding("Text", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["PROTECTION_ART"].ToString()));
FartcheckBoxGERER.DataBindings.Add(new Binding("Checked", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["GERER_ART"].ToString()));
FartcheckBoxACTIF.DataBindings.Add(new Binding("Checked", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ACTIF_ART"].ToString()));
FartMCCBfou.DataBindings.Add(new Binding("SelectedValue", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_FOU"].ToString()));
FartMCCBdoc.DataBindings.Add(new Binding("SelectedValue", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_DOC"].ToString()));
FartMCCBcat.DataBindings.Add(new Binding("SelectedValue", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_CAT"].ToString()));
FartMCCBuni.DataBindings.Add(new Binding("SelectedValue", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_UNI"].ToString()));
FartMCCBcri.DataBindings.Add(new Binding("SelectedValue", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_CRI"].ToString()));
FartMCCBmet.DataBindings.Add(new Binding("SelectedValue", BS_ART, Parametres.DS_GESPI.Tables["ARTs"].Columns["ID_MET"].ToString()));
}