Syncronizing across forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It is easy to tie two datagrids together (e.g. customers and orders) on a
single form as the currency manager keeps things under control. However,I
wold like to put the dependent table (e.g. orders) on a separate form. I've
tried a whole bunch of different ways to do this but can't seem to get the
dependent table syncronized with its parent (e.g. customers) in the main
form. The problem is that each form has its own currency manager. Can
someone please tell me a way to get this to happen.
 
Hi,

rossu said:
It is easy to tie two datagrids together (e.g. customers and orders) on a
single form as the currency manager keeps things under control. However,I
wold like to put the dependent table (e.g. orders) on a separate form.
I've
tried a whole bunch of different ways to do this but can't seem to get the
dependent table syncronized with its parent (e.g. customers) in the main
form. The problem is that each form has its own currency manager. Can
someone please tell me a way to get this to happen.

The same CurrencyManager is used for the same binding within the same
BindingContext, but each Form has its own BindingContext ( which is by
default shared by all Controls ).

You can share the BindingContext between Forms, eg :
ordersForm.BindingContext = customersForm.BindingContext;

HTH,
Greetings
 
Back
Top