views:

25

answers:

1

I've got in-memory dataset with some table defined and I populate this table in a following way:

for(...)
    ds.Fields.AddFieldsRow(++j, 0, heading, "Char", "", "", "Input", 0, "","","");

On the GUI I've got DataGridView bound to that table inside TabControl (bound through BindingSource).

Very strange thing is happening: if I open tab pane with this grid and populate table with some data then I see changes in grid. On the other side if I'm at other tab, populate table, and then switch to tab with grid I've got following exception: "DataMember property 'Fields' cannot be found on the DataSource".

In similar way I've got 2 tab panes with grid in each that are bound to the same datatable using different datasources and I open one of them, populate, see the changes, then switch to second tab and get crash.

What am I missing?

A: 

ok, silly me. was clearing dataset tables collection before populating it...

Shaine