TextBoxes not display content in RadTabControl

2 posts, 0 answers
  1. Edward
    Edward avatar
    1 posts
    Member since:
    Mar 2012

    Posted 08 Mar 2012 Link to this post

    I have on my application one Radtabcontrol with several RadTabItem as children.
    Each RadTabItem has a set of StackPanel that in turn has several components like TextBox, TextBlock, etc.

    The question is: The only items that are initialized are ones of currentTab and the others with excepion of TextBoxes. Why this error happens?

    It follows an snippet of code:

    InitializeComponent();

    InitializeComponent();
    this.Width = Utils.Current.Host.Content.ActualWidth - 100;
    this.Height = Utils.Current.Host.Content.ActualHeight - 100;
    Utils.ProgressBar(ref _semaphoreProgressBar, ref progressBar);
    LayoutRoot.KeyUp += new System.Windows.Input.KeyEventHandler(Utils.LayoutRoot_KeyUp);
    this.DataContext = new NFeValidator();
    LoadCombos();
    ResourcesUI();
    PermissionsUI();
    LoadFields();

    and the method LoadFields has the following structure:

    textBoxName.Text = data.Name;
    numericUpDownNumber.Value = data.Number;
    ...

    Just remebering all the fields (textBoxName, numericupDownNumber are children of Stackpanels that are children of RadTabItem.

    Do you know why this bug happen, or what to do to turn around it?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 13 Mar 2012 Link to this post

    Hi Edward,

    I am not sure if I understand your issue correctly. But if you want to keep the state of the content of all RadTabItems, then you can set the RadTabControl.IsContentPreserved property to True. More information about that property you can find in our online documentation.

    Please give it a try and let me know if it helps.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top