Tab Control Problem

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi, I was wondering if anyone has a solution for a tab
control problem that I am seeing. If I am on tabpage1 and
set the text values of fields on tabpage2 they don't seem
to stick.

If I click on tabpage2 I see the values, but if I click on
tabpage1 and then back to tabpage2, the values that I set
dissappear.

There are databindings on the fields, so this is probably
somehow causing the problem.
 
Databinding is not enabled on a control until it is visible. Thus, the
value you set on the controls are overridden when databinding is initialised
on the controls when the tab is made visible. Two solutions:

1) Force the tab to be visible before setting the values
2) Set the values in the underlying dataset, not the control.

Cheers,

Laurie Paulin
Perth, Western Australia
 
Back
Top