Connect Text Boxes on Form2 to dataGrid on Form1

  • Thread starter Thread starter esroinc
  • Start date Start date
E

esroinc

Have Form1 with dataGrid and text boxes bound to a dataset. This works
fine. Want to bring up another form (Form2) with text boxes to edit
the dataset. Using "this.textBox1.DataBindings.Add("Text",
classinstanceForm1.ds, NamesAddresses.FirstName"); will put the first
record in the database table in the text box, but will not put the
dataGrid selected record on Form1 in the Form2 text box. Need to
associate the text boxes on Form2 with the text boxes and dataGrid
selection on Form1.
 
Have Form1 with dataGrid and text boxes bound to a dataset. This works
fine. Want to bring up another form (Form2) with text boxes to edit
the dataset. Using "this.textBox1.DataBindings.Add("Text",
classinstanceForm1.ds, NamesAddresses.FirstName"); will put the first
record in the database table in the text box, but will not put the
dataGrid selected record on Form1 in the Form2 text box. Need to
associate the text boxes on Form2 with the text boxes and dataGrid
selection on Form1.

I don't think you can do it, but then again I personally despise data
binding and code everything by hand, so I may not know the "tricks."
Ultimately, though, I think you're just going to have to manually update the
data source from the information you gather in Form2. No idea how you're
going to do that, though.
 
Back
Top