Tabcontrol, datacontext doesn't update textbox

3 posts, 0 answers
  1. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 05 Mar 2010 Link to this post

    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. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 05 Mar 2010 Link to this post

    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.
  3. DevCraft banner
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 09 Mar 2010 Link to this post

    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.
Back to Top