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

Switching from tabitem to tabitem fires Loaded event?

4 Answers 646 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Harald Braunstein
Top achievements
Rank 1
Harald Braunstein asked on 27 Feb 2009, 12:47 PM
Hi,
well my question is already stated in the title... In the SL application in runtime, when with mouse switching(or selecting) tabitems, after the tabitem has been selected the Loaded event for the control embedded in the selected tabitem is fired.
This is not desired...
It is supposed to work that way? According the msdn documentation: the Frameworkelement.Loaded event "Occurs when a FrameworkElement has been constructed and added to the object tree. "

Thanks,
David

4 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 27 Feb 2009, 01:19 PM
Hello Harald,

Indeed, the MSDN documentation is correct and this is the expected behavior.

The items that are not visible have not been created yet and are not part of the visual tree. When you switch to a tab item, its content is only then fully initialized and added to the visual tree. Respectively, it is removed form the visual tree when not visible. Unfortunately there is no unloaded event that can be handled.

This is not to say that its template is applied multiple times, the template is applied just once. (Unless it is changed).

If this does not work in your scenario, maybe I can give more advice if I know why you need the preloading of the objects or them staying in the visual tree.

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
Srinivas
Top achievements
Rank 1
answered on 27 Jul 2009, 05:23 AM
Hello Miroslav,

You mentioned above that there is no unloaded event that can be handled but is there any workaround for this issue? In my scenario, I am using RadHTMLPlaceHolder in one of the tabs and when I switch to another tab the HTML contents of the current tab are still visible and overlapping on everything. I would like to make the RadHTMLPLaceHolder visibility to collapse before switching to other tabs.

Do you have any sample demonstrating this? I was trying to write some even handlers to do the same but I couldn't succeeded in doing so.

I am searching all forum posts but couldn't find any help on this. I really appreciate your help.

Regards,
Srinivas
0
Srinivas
Top achievements
Rank 1
answered on 27 Jul 2009, 06:22 AM
Hi,

I noticed something interestingly but I am not sure if this is how it was designed. When I set the Height & Width properties of RadHTMLPlaceHolder control, then when I switch to other tabs the HTML contents are overlapped on top of everything but not hidden automatically as other tab contents (which are not of RadHTMLPlaceHolder contents) but when I remove the Height & Width properties of RadHTMLPlaceHolder then when I switch to other tabs the HTML contents are hidden and everything seems to be OK.

I am not sure how Height & Width properties of RadHTMLPlaceHolder have any affect on overlapping.

Any help?

Thanks
Srinivas
0
Tihomir Petkov
Telerik team
answered on 28 Jul 2009, 03:10 PM
Hi Srinivas,

I investigated your issue and it turned out you hit an obscure bug in the RadHtmlPlaceholder control. We will investigate it in more detail and the bug should be fixed for our next major release - 2009 Q3.

Thank you for your feedback. I updated your Telerik points.

Kind regards,
Tihomir Petkov
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.
Tags
TabControl
Asked by
Harald Braunstein
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Srinivas
Top achievements
Rank 1
Tihomir Petkov
Telerik team
Share this question
or