problem with BindingContext[].EndCurrentEdit()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    #1

    problem with BindingContext[].EndCurrentEdit()

    Hi, I'm developing a program in MDI style

    I've got 2 froms



    MDIForm (parent form)

    Form2 (child form with dataGrid1 and myDataSet)



    In Form2 I've this



    public void UpdateDatabase( )

    {

    this.BindingCon text[myDataSet,"myta ble"].EndCurrentEdit ();



    //

    // here there is all the code for updating the database

    //

    }



    when I execute the program, when I'm editing and changing the vaule of a
    record;

    if I call UpdateDataBase( ) from a button in Form2 the
    BindingContext[].EndCurrentEdit () works fine, because it goes out from the
    edit mode and with "OleDataAdapter .Update" the data will be updated



    if I call UpdateDataBase( ) from a button in MDIForm the
    BindingContext. EndCurrentEdit( ) doesn't work because the record is still in
    edit mode and when I update the database that record wont be updated,



    thanks,

    Peter


Working...