Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When do bound controls on a form occur?

Status
Not open for further replies.

aprobe

Programmer
Dec 4, 2003
36
NZ
I have a form with multiple tabsheets on it.
When the user is updating an existing record I am trying to perform certain validation dependant upon the checked state of a checkbox on one of the tabs.
The checkbox is bound to a dataset but the checked state of that check box is ONLY set when the user sets focus to that tab.
The column in the dataset is True and if the user presses a Save button without navigating to the tabsheet containing the bound checkbox first the result is always an unchecked state.

Shouldn't ALL the bound controls be set when the current record changes without the need for the user to access all the tabsheets first?

Am I missing something, this should be basic surely?

Any help would be gratefully appreciated.
 
You can call Invalidate(true); on all the tab controls after doing an update. Seems a little odd but it may help.
 
This has not resolved the problem. Having spent many hours searching I found similar reported problems and it was also reported as a known MS bug.

Having pulled what little hair I have left out I kept trying different things.

Finally I have resolved it.

When the record position has changed, call the Show method of the tabsheet with the problem. (or loop through all tab sheets on the control).
There will be no visual changes but the controls will be updated immediately.
i.e. on a checkbox on the tabsheet, calling tabsheet.Show() will cause the checkbox.CheckStateChanged event to be raised.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top