I have a complex problem, could you please help me.
The problem:
I have a form with a TabControl
. There are two TabPages
in the first is a dataGridView
and in the second are multiple comboboxes
.
DataGridView
is filled with data from Table1
, on the other tab the first combobox
datasource is set to TableCB1
, the second combobox
to TableCB2
etc.
Between TableCB1, TableCB2
... are DataRelations
like (TableCB1.ID->TableCB2.ParentID
). I'm using databindings to bind current columns from table to controls.
When I open the form, first tabPage (dataGridView
) is filled and works ok, but if I select the second TabPage (with comboboxes
) then the combobox
selected items are not correct selected!!! Only the first combobox
is set correctly but all other have selected the first item in datasource until I change the bindingsource position or make dataset.rejectchanges()
.
But if make TabPage two to be shown on form load, then the combobox items are selected correctly!
I know it's a very specific problem but, hope somebody could help me to solve this problem.
I'm doing it on .NET3.5 and winforms.
Thanks.
The reply in this thread might be what you need: