Cant see HTMLPlaceHolder in RadWindow

4 posts, 0 answers
  1. yohai
    yohai avatar
    10 posts
    Member since:
    May 2009

    Posted 17 May 2009 Link to this post

    Hi,

    I've created a new silverlight project and add:
    <UserControl xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"  xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"  x:Class="SilverlightApplication2.Page" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
        Width="400" Height="300"
        <Grid x:Name="LayoutRoot" Background="White"
            <telerikNavigation:RadWindow Name="RadWindow1" Width="600" Height="600" Header="Test" > 
                <telerik:RadHtmlPlaceholder Name="RadHtmlPlaceholder1" SourceUrl="http://www.google.com/"></telerik:RadHtmlPlaceholder> 
            </telerikNavigation:RadWindow> 
        </Grid> 
    </UserControl> 

    and in the code file i add:
    public partial class Page : UserControl 
        { 
            public Page() 
            { 
                InitializeComponent(); 
     
                RadWindow1.Show(); 
                RadWindow1.LocationChanged += new RoutedEventHandler(RadWindow1_LocationChanged);             
            } 
     
            void RadWindow1_LocationChanged(object sender, RoutedEventArgs e) 
            { 
                RadHtmlPlaceholder1.InvalidateArrange();             
            } 
        } 

    when i run the application i see the window but i don't see the htmlplaceholder, why?
    if i copy the htmlplaceholder markup outside the radwindow i see google web site.

    what am i missing?



  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 18 May 2009 Link to this post

    Hi yohai,

    You need to open the RadWindow after the page has been loaded. Here is the modified code:
    public Page()  
            {  
                InitializeComponent();  
     
                Loaded += new RoutedEventHandler(Page_Loaded);  
                  
            }  
     
            void Page_Loaded(object sender, RoutedEventArgs e)  
            {  
                RadWindow1.Show();  
                RadWindow1.LocationChanged += new RoutedEventHandler(RadWindow1_LocationChanged);  
            } 


    All the best,
    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.
  3. DevCraft banner
  4. yohai
    yohai avatar
    10 posts
    Member since:
    May 2009

    Posted 18 May 2009 Link to this post

    Hi,

    thanks for the quick replay...

    I've done what you said and i am having VERY strange behavior with the controls,
    this is my user control xaml file:
    <UserControl xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"  xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"  x:Class="SilverlightApplication2.Page" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
        Width="400" Height="300"
        <Grid x:Name="LayoutRoot"
            <telerik:RadHtmlPlaceholder Name="RadHtmlPlaceholder2" SourceUrl="WebForm1.aspx"></telerik:RadHtmlPlaceholder> 
            <telerikNavigation:RadWindow Name="RadWindow1" Width="600" Height="600" Header="Test" > 
                <telerik:RadHtmlPlaceholder Name="RadHtmlPlaceholder1" SourceUrl="http://www.google.com/" HorizontalAlignment="Stretch"></telerik:RadHtmlPlaceholder> 
            </telerikNavigation:RadWindow> 
             
        </Grid> 
    </UserControl> 
     

    and this is the code file:
    using System; 
    using System.Windows; 
    using System.Windows.Controls; 
     
    namespace SilverlightApplication2 
        public partial class Page : UserControl 
        { 
            public Page() 
            { 
                InitializeComponent(); 
                 
                Loaded += new RoutedEventHandler(Page_Loaded); 
            } 
     
            void Page_Loaded(object sender, RoutedEventArgs e) 
            { 
                RadWindow1.Show(); 
                RadWindow1.LocationChanged += new RoutedEventHandler(RadWindow1_LocationChanged); 
            }   
     
            void RadWindow1_LocationChanged(object sender, RoutedEventArgs e) 
            { 
                RadHtmlPlaceholder1.InvalidateArrange(); 
            } 
        } 
     
     
    Please look in this image:
    Running Sample

    you can see that i have 2 HtmlPlaceHoder, 1 outside (before) the RadWindow and 1 inside the RadWindow.
    i only see the second HtmlPlaceHoder(Google site) in the boundaries of the first HtmlPlaceHolder even when i moving the window around.
    if i put the first HtmlPlaceHoder AFTER the RadWindow, I can't see the second HtmlPlaceHoder just as i have in the beginning before i changed the code.

    I am testing your product for our company,  we need to build a very BIG MDI environment website,
    and we want to have sliverlight as our container for the MDI environment, and all the pages will by ASP.NET inside silvelight.
    So this is the main feature that we need from your product.

    Any help would be appreciate,

    Thanks
    Yohai
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 19 May 2009 Link to this post

    Hello yohai,

    The problem in this setup is that you can not overly the HtmlPlaceholder with a RadWindow. This is a limitation in the HtmlPlaceholder control. The reason for this is that the HTML placeholder needs be rendered _over_ the whole Silverlight application in order to display the HTML content. The only workaround is to hide the HTMLPlacehiolder that is not in the window when the window move over it.


    Sincerely yours,
    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.
Back to Top