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

Strange Behavior: items disappear when control dynamically added.

2 Answers 66 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Barry Hester
Top achievements
Rank 2
Barry Hester asked on 30 Apr 2009, 09:35 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 01 May 2009, 02:28 PM
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.
0
Barry Hester
Top achievements
Rank 2
answered on 01 May 2009, 03:11 PM
Worked like a champ!  Thank you very much.
Tags
TabControl
Asked by
Barry Hester
Top achievements
Rank 2
Answers by
Miroslav
Telerik team
Barry Hester
Top achievements
Rank 2
Share this question
or