It took some @£$½£$@£-work and swearing, but I finally found the
solution to my problem. For others with the same problems I repost what
I found. The following code is from another post and it proved useful:
http://groups.google.com/groups?hl=no&lr=&c2coff=1&selm=4lbhr056e0i0k48hondf8o89
cop47uugsa%404ax.com&rnum=9
dataGrid1.DataSource = myCustomersDataset.Customers
dataGrid1.DataMember = ""
textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text",
myCustomersDataset.Customers, "CompanyName"))
dataGrid2.DataSource = myCustomersDataset
dataGrid2.DataMember = "Customers"
textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text",
this.myCustomersDataset, "Customers.CompanyName"))
Mixing these two versions of using the bindings results in (in my case)
the TextBox being bound to the first row of the grid and getting stuck
there unless the CurrencyManager.Position is updated manually. Very
frustrating, but I hope this might shed some light on the situation for
others that suffer the same problem as I.
Cheers!
- Peder -
> How do I bind a TextBox to a DataGrid? If I bind it to the DataGrid
> DataTable, the TextBox doesn't get updated when I select another row. Do
> I need to handle some DataGrid events?
>
> - Peder -