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

Vertical scrollbar showing

3 Answers 87 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zatzh
Top achievements
Rank 1
Zatzh asked on 10 Feb 2012, 02:48 PM
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


3 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 14 Feb 2012, 04:25 PM
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 >>
0
Wan
Top achievements
Rank 1
answered on 21 Mar 2012, 04:28 AM
Hi,
    Have you solved this problem? Please give me some advices.Thanks!
0
Tina Stancheva
Telerik team
answered on 23 Mar 2012, 03:13 PM
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 >>
Tags
HTMLPlaceHolder
Asked by
Zatzh
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Wan
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or