Disappearing problem

11 posts, 0 answers
  1. Ionica Marian
    Ionica Marian avatar
    2 posts
    Member since:
    Jul 2009

    Posted 10 Jul 2009 Link to this post

    Hi,

    I have the fallowing scenario:

    Standard TabControl (from silverlight toolkit), with 2 tabs.
    On the second tab, I have a RadHtmlPlaceholder.

    I set the HtmlSource property programatically.

    I click on the second page (where the control is placed), and everything seems to be ok.

    If I go back to the first page, and then to the second page, I can't see the control.

    Any ideas ?
  2. Ionica Marian
    Ionica Marian avatar
    2 posts
    Member since:
    Jul 2009

    Posted 10 Jul 2009 Link to this post

    Resolved with

    RespectSilverlightLayoutMeasure="True" 

     

     

     

     

     

     

  3. DevCraft banner
  4. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 26 Jul 2009 Link to this post

    Hi,

    I am using RadTabControl with two tabs and in the second tab I placed HTMLPlaceHolder and the SourceUrl I am setting dynamically. When I run the application I can switch to second tab where the HTMLPlaceHolder present and the URL contents are shown correctly, but when I switch back to first tab the HTMLPlaceHolder contents still appears on the screen but the contents are placed on the left top corner of the browser.

    Based on what I understand the HTMLPlaceHolder is painted on top of silverlight controls but when I switch the tabs how to make the HTMLPLaceHOlder contents hidden? Can you please help me resolve this? I try to use LosFocus event of the tab item but still no use.

    This issue is very critical for us and needs to resolve as quickly as possible. Please help me.

    Thanks
    Srinivas
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 28 Jul 2009 Link to this post

    Hello Srinivas,

    I could reproduce this and it seems that it is a bug in the HtmlPlaceholder.

    Your Telerik Points have been updated for the feedback.

    The problem seems to arise from the fact that Layout is not updated for the HtmlPlaceholder. For me this happened only when I explicitly set the size of the Placeholder, otherwise it was disappearing as expected.

    The workaround here is to update the visibility of the control if you are switching to the tab with this control, like so:

    void tabControl_SelectionChanged(object sender, RoutedEventArgs e)  
    {  
        //let's say that the HtmlPlaceholedr is on the second page (index 1)  
        placeholder.Visibility = tabControl.SelectedIndex == 1 ? Visibility.Visible : Visibility.Collapsed;  
        placeholder.UpdateLayout();  

    Does this work for you?

    Kind regards,
    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.
  6. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 29 Jul 2009 Link to this post

    Hello Miroslav,

    Yes, I need something like this but in my case the tabs are dynamically created and the RadHTMLPlaceHolder could be in any of those tabs and the user might click any tab. The maximum number of tabs that we will be allowing is 6, so for example if the RadHTMLPlaceHolder exists in 5 of the tabs and if the user switch from tab 4 to 2 then in this case how do I set the visibility of 4 to Collapased and 2 to Visible, to start with I need this logic during new tab creation process as well, as first I need to collapse the RadHTMLPlaceHolder of the current tab and then create the new tab with visible?

    One option I can think of is to run thru a loop of TabControl (every time in selectionChanged method) and check each tab for an RadHTMLPlaceHolder control and if the tab index is not same as newly selected tab then set the visibility to Collapsed. But I am not sure if this is the right approach. Also, I am not sure how to write this loop in a better way. Can you please advice me further on this or if you have a sample code?

    Please note that the RadHTMLPlaceHolder could be in any of the 6 tabs or it could be in all 6 tabs.

    I really appreciate your help.

    Thanks
    Srinivas
  7. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 03 Aug 2009 Link to this post

    Hello Srinivas,

    Are the contents of the TabItem visual objects? If so, I think that the following implementation will be more appropriate for you:

    void tabControl_SelectionChanged(object sender, RoutedEventArgs e)  
    {  
        var selectionArgs = e as RadSelectionChangedEventArgs;  
        // All html placeholders are collapsed on application startup. Then  
        // there is no need to set the the first time.  
     
        if (selectionArgs.RemovedItems.Count > 0)  
        {  
            //Get the old selection, find the item and search its cotnent for HtmlPlaceholders.  
            var oldItem = selectionArgs.RemovedItems[0];  
     
            //Get the container of the item:  
            var oldContainer = tabControl.ItemContainerGenerator.ContainerFromItem(oldItem) as RadTabItem;  
     
            //get its contents:  
            var contents = oldContainer.Content as FrameworkElement;  
     
            //Find all HtmlPlaceholdres and hide them;  
            foreach (var oldPlaceholder in contents.ChildrenOfType<RadHtmlPlaceholder>())  
            {  
                oldPlaceholder.Visibility = Visibility.Collapsed;  
                oldPlaceholder.UpdateLayout();  
            }  
        }  
     
        if (selectionArgs.AddedItems.Count > 0)  
        {  
            var newContents = tabControl.SelectedContent as FrameworkElement;  
            foreach (var newPlaceholder in newContents.ChildrenOfType<RadHtmlPlaceholder>())  
            {  
                newPlaceholder.Visibility = Visibility.Visible;  
                newPlaceholder.UpdateLayout();  
            }  
        }  

    Let me just say again that this is a workaround for an existing problem and normally you are not expected to do this.

    Best wishes,
    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.
  8. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 03 Aug 2009 Link to this post

    Hello Miroslav,

    Yes, all my TabItems has Visual Objects. Thank you very much for your help on this. I will apply this mechanism as a workaround and see how it works.

    Thank you very much.
    Srinivas
  9. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 08 Aug 2009 Link to this post

    Hello Miroslav,

    I am experiencing two problems and I am not sure where the problem is and both are related to RadHTMLPlaceHolder.

    1. I am creating RadTabItems dynamically and placing RadHTMLPlaceHolder in each tab item, by creating multiple instances of a specific XAML page that contains the RadHTMLPlaceHolder. When I switch between the tabs the contents of the RadHTMLPlaceHolder can be VISIBLE only when I move my mouse pointer (after clicking on the tab item) over to the contents area of the tab. But if I keep my mouse pointer on the TabItem itself (even after clicking the tab) then the contents are not visible and I am not sure where the problem is.

    2. I have placed a "Close" icon for the tab (using one of your sample code from other forum) and when I close the icon the tabs are closing properly but occassionally I get the following warning message and when I click OK then the browser gets closed and when I click on cancel and then try to close the tab using the icon then it works OK. I am trying to narrow down this issue but not successful so far.

    Warning Message when I try to close the tab which contains RadHTMLPlaceHolder:

    Windows Internet Explorer
        The webpage you are viewing is trying to close the window.
        Do you want to close this window?

            OK    Cancel



    Any help is great.

    Thanks
    Srinivas 
  10. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 10 Aug 2009 Link to this post

    Hi Srinivas,

    Can you open a support ticket and send us a sample code that generates those errors.

    Thanks!

    Regards,
    Valentin.Stoychev
    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.
  11. Michael
    Michael avatar
    15 posts
    Member since:
    Dec 2009

    Posted 06 Dec 2010 Link to this post

    I'm having a very similar problem that turned up recently.  I just installed the 2010.2.1029.1040 version of the DLLs and now the HTML Place Holder will not re-appear when setting visibility back to  Visibility.Visible when using IE 8.0.7600.16385 in non-compatibility mode.

    Steps to reproduce.
    1. tabularReportHtmlPlaceHolder.Visibility = Visibility.Visible;           
    2. tabularReportHtmlPlaceHolder.SourceUrl = new Uri(url);
      1. Website is displayed
    3. tabularReportHtmlPlaceHolder.Visibility = Visibility.Collapse;
      1. Tab Control disapears.
    4. tabularReportHtmlPlaceHolder.Visibility = Visibility.Visible;  
      1. Tab Control does not re-appear!

    This used to work and no longer does.  As a work around I now add the following after step 4.
    --  tabularReportHtmlPlaceHolder.SourceUrl = new Uri(tabularReportHtmlPlaceHolder.SourceUrl.AbsoluteUri);

    Is this a bug with the new version of the DLLs?

    Thanks,
    Michael

  12. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 09 Dec 2010 Link to this post

    Hello Michael,

    I couldn't reproduce the issue on our side. Can you please have a look at the attached sample and let me know if I am missing something.

    Thank you in advance.

    Best wishes,
    Tina Stancheva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top
DevCraft banner