Vertical scrollbar showing

4 posts, 0 answers
  1. Zatzh
    Zatzh avatar
    5 posts
    Member since:
    Sep 2012

    Posted 10 Feb 2012 Link to this post

    hi ,

    i am using radhtmlplaceholder controls in my page to display html text through htmlsource .
    My problem is its showing vertical scrollbars when a lengthy text is set as htmlsource.I have tried setting style attribute as
    you guys provided in similar threads to set iframe scrolling attribute .But that also didn't worked.Can you guys help me .I will send my sample code if required where you want to.Any help appriciated in advance.

    thanks
    satheesh


  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 14 Feb 2012 Link to this post

    Hello Zatzh,

    Thank you for contacting us. Could you please send us a sample project reproducing the issue. This way we will be better able to assist you. Thank you for your cooperation.

    Greetings,
    Kiril Stanoev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Wan
    Wan avatar
    10 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2012 Link to this post

    Hi,
        Have you solved this problem? Please give me some advices.Thanks!
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 23 Mar 2012 Link to this post

    Hi,

    When the RadHtmlPlaceholder.HtmlSource property is set, the control creates a div object and places the HtmlSource in it and then it will place the div object inside the page that hosts the Silverlight  plug-in.

    This is why the way the RadHtmlPlaceholder's content is rendered strongly depends on the styles applied to the page that hosts the Silverlight  plug-in. So when you want to remove any automatic scroll viewers, you have to examine the web page style and make sure it allows it.

    In most cases you can only set the overflow property of the div element that the RadHtmlPlaceholder creates to hidden, like so:
    void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        string HtmlString = String.Empty;
        for (int i = 0; i < 5; i++)
        {
            HtmlString += @"You can display <b>any</b> <span style=""color:#FF0000;"">valid</span>
    <i>html</i> content.<br/>It will be displayed as part of the <a href=""http://silverlight.net""
    target=""_blank"">Silverlight</a> page<br/> and will be rendered by the browser.";
        }
        HtmlPlaceholder.HtmlSource = HtmlString;
        HtmlElement element = HtmlPlaceholder.HtmlPresenter;
        if (element.Children.Count > 0)
        {
            HtmlElement child = element.Children[0] as HtmlElement;
            child.SetStyleAttribute("overflow", "hidden");
        }
     
    }

    I hope this approach will work for you, but if it doesn't, it's best to send us a small project demonstrating your scenario so that we can examine it and suggest a better suited approach.

    Greetings,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top