Switching from tabitem to tabitem fires Loaded event?

5 posts, 1 answers
  1. Harald Braunstein
    Harald Braunstein avatar
    11 posts
    Member since:
    Sep 2006

    Posted 27 Feb 2009 Link to this post

    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
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 27 Feb 2009 Link to this post

    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.
  3. DevCraft banner
  4. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 27 Jul 2009 Link to this post

    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
  5. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 27 Jul 2009 Link to this post

    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
  6. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 28 Jul 2009 Link to this post

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