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

Displaying System.Windows.Controls.WebBrowser in RadWindow

3 Answers 367 Views
Window
This is a migrated thread and some comments may be shown as answers.
Simon Neill
Top achievements
Rank 1
Simon Neill asked on 22 Feb 2010, 02:48 PM
Hi I'm trying to display a System.Windows.Controls.WebBrowser in a RadWindow. The WebBrowser does not appear to render properly. The WebBrowser control is there (I can right click and display the context menu) but the page it displays is not visible? The following code snippets should demonstrate the issue...
Create the RadWindow in response to a button click...
<Window x:Class="TelerikForm.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    Title="Window1" Height="300" Width="300"
    <Grid> 
    <Button Name="launchWindow" Content="launchNewWindow" Click="launchWindow_Click" /> 
  </Grid> 
</Window> 
private void launchWindow_Click(object sender, RoutedEventArgs e) { 
  RadWindow testWindow = new RadWindow(); 
  testWindow.Content = new Browser(); 
  testWindow.Show(); 
And add some content containing the WebBrowser...
<UserControl x:Class="TelerikForm.Browser" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="600" Height="600"
    <StackPanel> 
    <Border Width="590" Height="590" Margin="5" BorderBrush="Black" BorderThickness="1"
      <WebBrowser Name="browser" Loaded="browser_Loaded" > 
      </WebBrowser>       
    </Border> 
    </StackPanel> 
</UserControl> 
private void browser_Loaded(object sender, System.Windows.RoutedEventArgs e) {       
      browser.Navigate(new Uri("http://www.google.co.uk/", UriKind.RelativeOrAbsolute), nullnull""); 
Thanks in advance..Simon...

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Feb 2010, 04:17 PM
Hello Simon,

The RadWindow control doesn't support WebBrowser control as it is displayed into a transparent WPF Window and the WPF Window doesn't support hosting WebBrowser control when it is in transparent mode. What I could suggest you is to use a WPF Window control to host the WebBrowser control.

Best wishes,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Miroslav Nedyalkov
Telerik team
answered on 25 Jun 2013, 08:35 AM
Hi Simon,

I just want to add that there is a work-around for this limitation now - you just need to set the AllowTransparency attached property of the RadWindow control to false. Here is an example how to do this:
var window = new RadWindow
{
    Content = new WebBrowser { Source = new Uri("http://www.telerik.com/") },
    Width = 700,
    Height = 500
};
RadWindowInteropHelper.SetAllowTransparency(window, false);
window.Show();

Regards,
Miroslav Nedyalkov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Datafyer
Top achievements
Rank 1
answered on 25 Sep 2014, 01:36 AM
Awesome! Thanks for the update. I had this same issue and now it is solved.
Tags
Window
Asked by
Simon Neill
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Datafyer
Top achievements
Rank 1
Share this question
or