Hello,
I am showing html websites from my Silverlight project using RADHtmlPlaceHolder.I placed RADHtmlPlaceHolder within the RADWindow.
When I open the Multiple Webstes(By clicking Link Links from My project), Multiple Rad windows are opening and Multiple Websites are showing at the same time. But When I drag one Radwindow ,the other Radwindows part getting cut off or showing unusual behavior.Sometimes the sites are not loading also..
Please give me some solution,
Jobin
5 Answers, 1 is accepted
About the issue when the RadHtmlPlaceholder does not reload its content, you can try setting the KeepContentInMemory property to True.
<telerik:RadWindow x:Name="window1" Width="500" Height="500"> <telerik:RadHtmlPlaceholder SourceUrl="http://www.google.com" KeepContentInMemory="True" /></telerik:RadWindow>As for the overlay issue, this is a known behavior when there are multiple RadHtmlPlaceholder controls on the page. RadHtmlPlaceholder in its core is just an IFrame element that is rendered on top of the SIlverlight plugin so anything that is part of the Silverlight plugin (except the RadHtmlPlaceholder) will be rendered bellow the RadHtmlPLaceholder. One possible workaround is to collapse all the RadHtmlPlaceholder controls, except the one you're dragging. Give it a try and let me know how it goes. Kind regards,
Kiril Stanoev
the Telerik team
Hi,
Thanks for your reply.
First one Got worked for me.
But while collapse, the other rad windows will not be displayed .Right?
I want to show Multiple Windows at the same time on the same screen.
I am using Following Code to genareate Rad Window and Html Place Holder.
RadWindow ObjRadWindow = new RadWindow();
ObjRadWindow.LocationChanged += new RoutedEventHandler(ObjRadWindow_LocationChanged);
RadHtmlPlaceholder ObjPlaceHolder = new RadHtmlPlaceholder();
ObjPlaceHolder.KeepContentInMemory = true;
ObjPlaceHolder.SourceUrl = new Uri(((HyperlinkButton)sender).Tag.ToString());
ObjRadWindow.Content = ObjPlaceHolder;
So how can i solve My problem?
You're correct when you say that while dragging, all the other windows will be empty (not displayed). Unfortunately there's not much you can do about it. This is the only proper solution for this scenario.
1. Start dragging a window
2. Collapse the HtmlPlaceholders in the all windows except the one you're dragging.
3. When dragging is complete, visualize all HtmlPlaceholders.
<Grid x:Name="LayoutRoot" Background="White"> <telerik:RadWindow x:Name="window1" Width="500" Height="500" LayoutChangeEnded="Window_LayoutChangeEnded" LocationChanged="Window_LocationChanged"> <telerik:RadHtmlPlaceholder SourceUrl="http://www.google.com" KeepContentInMemory="True" /> </telerik:RadWindow> <telerik:RadWindow x:Name="window2" Width="500" Height="500" Left="500" LocationChanged="Window_LocationChanged" LayoutChangeEnded="Window_LayoutChangeEnded"> <telerik:RadHtmlPlaceholder SourceUrl="http://www.telerik.com" KeepContentInMemory="True" /> </telerik:RadWindow> <telerik:RadWindow x:Name="window3" Width="500" Height="500" Top="500" LayoutChangeEnded="Window_LayoutChangeEnded" LocationChanged="Window_LocationChanged"> <telerik:RadHtmlPlaceholder SourceUrl="http://www.yahoo.com" KeepContentInMemory="True" /> </telerik:RadWindow></Grid>public partial class MainPage : UserControl{ private List<RadWindow> windows = new List<RadWindow>(); public MainPage() { InitializeComponent(); this.windows.Add(this.window1); this.windows.Add(this.window2); this.windows.Add(this.window3); foreach (var window in this.windows) { window.Show(); } } private void Window_LocationChanged(object sender, RoutedEventArgs e) { RadWindow draggedWindow = sender as RadWindow; foreach (var window in this.windows) { if (window != draggedWindow) { (window.Content as RadHtmlPlaceholder).Visibility = System.Windows.Visibility.Collapsed; } } } private void Window_LayoutChangeEnded(object sender, EventArgs e) { RadWindow draggedWindow = sender as RadWindow; foreach (var window in this.windows) { if (window != draggedWindow) { (window.Content as RadHtmlPlaceholder).Visibility = System.Windows.Visibility.Visible; } } }}Kind regards,
Kiril Stanoev
the Telerik team
Thank you Kiril,
I implemented the ocde that you posted and solved the problem for Dragging.
But still have one issue.
Please see the attached picture.
How can i solve this?
Unfortunately this is a limitation of the RadHtmlPlaceholder control that we cannot control. Since you have three different HtmlPlaceholders that are rendered above the whole SL application, the order in which they are rendered and the way they ovelap each other, cannot be contolled by the SL app.
Regards,
Tina Stancheva
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
