none
Add Row with Button control in Data Grid View in Visual Basic 2008

    Question

  • hi,

    i want to add rows with buttonControl in form1
    then when i click buttoncontrol in form1.  form2.show with data like in datarows, in every time i change data in form2 data in row in form1also change. is this possible???
    Thursday, August 29, 2013 3:14 AM

Answers

  • Hi Jehurtz,

    To my understood,you want two DataGridViews synchronous update.

    The following method maybe help you:

    Both two DataGridViews binding the same datasource . Add form2 corresponding event handler

    (eg:form close, savebutton click) in form1.

    The following code uses the database is default database northwind.

    public Form1() { InitializeComponent(); subform.FormClosed+=subform_FormClosed; } SubForm subform= new SubForm (); //You can use other events

    void subform_FormClosed(object sender, FormClosedEventArgs e) { this.categoriesTableAdapter.Fill(this.northwind40DataSet.Categories); }

    Hope you can help.



    Thursday, August 29, 2013 8:38 AM