Click here to Skip to main content
15,917,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On a TabControl, there is a ListBox and a TextBox on the second TabPage.
The ListBox bound to a DataTable, to display Col1 from all Rows. The Text of TextBox is bound to Col2, to display the the Value from the DataRow belongs to the selected item in the ListBox.

This works very well.

The problem is:
Before the second Tabpage is first shown, the Text of the TextBox will not be updated, if the DataTable is filled or the selected item respectively the selected index is changed, but the Text of the ListBox shows the correct value form the DataRow.

After first selecet of the second TabPage the problem is gone, regardless of whether the second TabPage is currently selected or not.

I need a right Text value in the TextBox for serveral checkings.

That's why I would like to know how I can ensure that the data binding works without a first activation of the second TabPage.

What I have tried:

I tried around with ReadValue() and WriteValue() for the bindings, and also for the whole Form recursivly. But it didn't work.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900