WebBrowser in RadWindow content "white"

4 posts, 1 answers
  1. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 20 Sep Link to this post

    Hi to all,

    I created a RadWindow that contains WebBrowser control.

    Simply, I execute Navigate method in Loaded event of RadWindow

    It navigates to local url http://mylocalserver:8090/blablabla

    When I open the window it appers empy, but if view HTML source is full, moreover, if I try to printer preview appers all content of webpage.

    Are there problems between RadWindow control and WebBrowser?

    PS: I tryed to exec InvalidateLayout method of RadWindow, but without resolve.

     

    <telerik:RadWindow x:Class="Brema.Client.Helpers.BlogViewer"
            Header="Aiuto in linea" Height="640" Width="480" WindowStartupLocation="CenterScreen" Style="{StaticResource RadWindowStyle}">
        <Grid>
            <WebBrowser x:Name="MainWebBrowser" />
        </Grid>
    </telerik:RadWindow>

  2. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 20 Sep in reply to Dario Concilio Link to this post

    I tryed using Window control standard, in this way it's OK!

    Then I think that I have to "something" about RadWindow.......

  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Polya
    Admin
    Polya avatar
    199 posts

    Posted 21 Sep Link to this post

    Hello Dario,

    The RadWindow control doesn't support WebBrowser control out of the box because it is displayed into a transparent WPF Window and the WPF Window doesn't support hosting WebBrowser control when it is in transparent mode.

    That said, in order to allow hosting a WebBrowser in a RadWindow we should change its transparency.
    We can do that by setting the AllowTransparency attached property of the RadWindow control to false:

    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,
    Polya
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  5. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 21 Sep in reply to Polya Link to this post

    Ok it's clear!

    It's works.

    Thank you.

Back to Top