This is a migrated thread and some comments may be shown as answers.

Tabcontrol, datacontext doesn't update textbox

2 Answers 58 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Gilbert van Veen
Top achievements
Rank 1
Gilbert van Veen asked on 05 Mar 2010, 01:58 PM
Hi everyone,

I have a tabcontrol which exists out of 6 tabs. For each tab I set the Datacontext. When I click on a tab then it opens and shows me the textboxes (which are bound to the datacontext) and the data is shown.

When I close the screen then I run some test to see if every textbox is not empty. I do this by calling MyTextbox.Text etc.

Now there is one strange thing. When the check runs only text is found in textboxes which are shown on the screen once. F.i. if I have values in a textbox on tabpage 6 but I don't open this tab then the system thinks that these textboxes are still empty. In other words the datacontext is not filling in these textboxes? The textboxes are only filled (linked to the datacontext) when they are shown on the screen?

2 Answers, 1 is accepted

Sort by
0
Gilbert van Veen
Top achievements
Rank 1
answered on 05 Mar 2010, 02:14 PM
I agree that the answer is also in my question. I can check the values of the DataContext instead of the textboxes but I was wondering if this is correct.
0
Valentin.Stoychev
Telerik team
answered on 09 Mar 2010, 08:32 AM
Hi Gilbert van Veen,

this is expected behavior - the tabs that are not displayed are still not part from the visual tree and thus do not receive the data context. Once you select the tab - it should be ok.

Kind regards,
Valentin.Stoychev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TabControl
Asked by
Gilbert van Veen
Top achievements
Rank 1
Answers by
Gilbert van Veen
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or