Strange Behavior: items disappear when control dynamically added.

3 posts, 1 answers
  1. Barry Hester
    Barry Hester avatar
    11 posts
    Member since:
    Feb 2005

    Posted 30 Apr 2009 Link to this post

    Hello there,

    I am using a rad docking layout and a radmenu.  In the documenthost I have a proportional stack panel.  I have another control that has a RadTabControl.  In the RadTabItem, controls intermittently disappear.  If I go to another tab and then back to the original tab, the items are back.  I have enclosed a link to a pared-down version of the code in a zip file.  To repeat the beavior,

    1. Start the app
    2. Click on Admin > Manage Template Field Settings Relationships.
    3. Repeat step 2 until you see the Listbox control disappear. (You will notice a difference in the layout).

    It looks like a redraw issue.  I have tried to invalidateArrange() on the affected RadTabItem to no avail.

    Please take a look at the code and see if you can see if it's user error or if there is indeed a rendering bug.

    Thanks,

    SilverlightSandbox.zip
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 01 May 2009 Link to this post

    Hi Barry,

    Sometimes there are bugs where we least expect them, even in the basic controls. In your case are using a Canvas panel in the TemplateFieldsAdministrator which is causing the issue.

    The canvas panel sometimes behaves oddly and messes up the layout of seemingly unrelated controls. Also if there is no Background set, sometimes it will decide to "handle" mouse events so controls in or around it will behave strangely.

    In your case:
    1. Just comment out the Canvas panel,
    2. Call InvalidateMeasure and UpdateLayout for the Canvas or like so:

    this.MainStackPanel.InvalidateMeasure();  
    this.MainStackPanel.UpdateLayout(); 

    Generally you will save yourself some headaches if you avoid the Canvas panel :)

    Sincerely yours,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Barry Hester
    Barry Hester avatar
    11 posts
    Member since:
    Feb 2005

    Posted 01 May 2009 Link to this post

    Worked like a champ!  Thank you very much.
Back to Top