Binding two CurrencyManagers

  • Thread starter Thread starter Stefan Rose
  • Start date Start date
S

Stefan Rose

Hello,
I have a Windows forms with a DataGrid and a set of Lables.

The DataGris views few fields from the source DataTable, and the Lables are
supposed to view the rest.
How can I bind the CurrencyManager of the DataGrid and the one of the
Lables, that when I select a row in the DataGrid the Lables view the right
information.

thanks in advance
 
Hi Stefan,

Use same pattern for binding, example:
dataGrid1.DataSource = dataTable1;

label1.DataBindings.Add("Text", dataTable1, "Column2");

Note that in both cases datasource is the same object.
 
Hi,

As long as you bind the labels and the datagrid to the same
datatable or dataview the currencymanager will keep them in sync.

Ken
 
Ken,

Yes but...

Since it's one of the most frustrating errors I'd like to add "in exactly
the same way". If one binding has the DataSet as the object, and the other
has the DataTable, you get two different currency managers and they are not
kept in sync. As long as their is a single currency manager, they'll stay in
sync (although I can't remember offhand whether labels update correctly).

Kathleen
 
Back
Top