Groups | Blog | Home
all groups > dotnet windows forms databinding > july 2005 >

dotnet windows forms databinding : Data binding across two forms


Markus Frischholz
7/27/2005 1:13:32 PM
Hello,

I use one form with a DataGrid control for navigation through a DataTable
and a second form with TextBoxes for some detail data. The second form should
reflect the current data row of the first form.

My question is: Is it possible to bind the controls to the second form to
the CurrencyManager of the first?

So far I tried to synchronize both CurrencyManager objects but I ran into
some problems when new records are appended and I wonder if there is an
easier solution.

Any help appreciated.
Thanks in advance.
Markus Frischholz
7/28/2005 6:22:02 AM

[quoted text, click to view]

Thanks, this works just fine.
Bart Mermuys
7/28/2005 3:05:30 PM
Hi,
[Inline]

"Markus Frischholz" <MarkusFrischholz@discussions.microsoft.com> wrote in
message news:B5765D4D-E5DA-4440-9F17-67884FE2EDA0@microsoft.com...
[quoted text, click to view]

Yes if you use the same BindingContext then the same CurrencyManager will be
used for the same DataSource/DataMember, eg:

detailForm.BindingContext = listForm.BindingContext;

Preferably you set this before the detail form binds, but it will work after
too.

HTH,
Greetings


[quoted text, click to view]

AddThis Social Bookmark Button