HTML control inside viewbox

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    2 posts
    Member since:
    Apr 2011

    Posted 05 Apr 2011 Link to this post


    I have a control, with 3 columns. In the middle column I have a RadHtmlPlaceholder which fills the available space.
    One requirement for this control is to work inside a viewbox.
    My problem is that because the actual width and heigth of the HtmlPlaceholder are not changing when stretching the viewbox content, the HTML content has always the same size.

    Is there a way to set the iframe width and heigth? (I know the scaling factor)

  2. Petar Mladenov
    Petar Mladenov avatar
    3155 posts

    Posted 07 Apr 2011 Link to this post

    Hello Daniel,

    Could you please send us your xaml so that we can get into your situation quickly? This way we could think up a workaround because there are some known issues of the RadHtmlPlaceholder related to resizing. On the other hand, do you actually need ViewBox? Are you going to use it only for the RadHtmlPlaceholder? Thank you in advance for your cooperation.

    Petar Mladenov
    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
  3. Joshua
    Joshua avatar
    22 posts
    Member since:
    Sep 2010

    Posted 19 May 2014 in reply to Petar Mladenov Link to this post

    Hello Telerik Support Team,

           Is there any resolution to fix the Scroll / Re-sizing issues for RadHtmlPlaceHolder inside a ViewBox ?
    We used ViewBox on a parent page, so there is no way we can remove it at this point.  

    FYI: When we tried RadHtmlPlaceHolder outside current project its working fine. But, issue is only when its inside a viewbox

    Thanks for your help. 
  4. Martin Ivanov
    Martin Ivanov avatar
    2608 posts

    Posted 22 May 2014 Link to this post

    Hi Joshua,

    Keep in mind that the RadHtmlPlaceHolder control is not placed directly in the Silverlight plugin, which means that it is positioned above the plugin. When you place a html placeholder inside a ViewBox it won't be resized correctly. This is why instead of ViewBox I recommend you to use a Grid with columns and rows, this way the the placeholder will be resized properly. Another approach could be to handle the SizeChanged event of the viewbox and set the width and height of the placeholder inside the event handler. Here is an example code:
    private void Viewbox_SizeChanged(object sender, SizeChangedEventArgs e)       
        this.placeholder.Width = this.viewbox.ActualWidth;
        this.placeholder.Height = this.viewbox.ActualHeight;

    Let me know if you have further questions.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top