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

Not showing all content

4 Answers 97 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Dan Normington
Top achievements
Rank 1
Dan Normington asked on 29 Jun 2009, 01:02 PM
I'm using the HTMLPlaceHolder control to display custom content from our content management system. When the html renders in the control I don't see all of it. There is no vertical scrollbar. So I ended up adding a scrollviewer around the htmlplaceholder and it only scrolls a little bit. Is there something I need to do?

I have evaluated many html host controls in the past month and this seems to be a common problem with the ones I've looked into. They all seem to render URL based sources just fine, but when It comes to using custom html content I seem to be running into the same issue.

Thanks in advance.

4 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 29 Jun 2009, 01:06 PM
Hello Dan Normington,

Can you wrap the content that you are displaying into a DIV with overflow:auto. Somthing like that:

String html = "<div style='overflo:auto'>" + CMSHtmlContent + "</div>";

Please let us know if this works for you.

All the best,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dan Normington
Top achievements
Rank 1
answered on 29 Jun 2009, 01:18 PM

After I posted I noticed another thread that you posted an example to with the following code after InitializeComponent:

 

RadHtmlPlaceholder1.HtmlPresenter.SetStyleAttribute(

 

"overflow", "auto");

 

RadHtmlPlaceholder1.HtmlPresenter.SetAttribute(

 

"id", "RadHtmlPlaceholder1");

 

 


Thanks for posting that. It did work for me, however, I'm getting a horizontal scrollbar that is very small. I'd like to get rid of that. Is there something I can do for this?

basically what is happening is that vertical scrollbar is taking up horizontal real estate.

Thanks in advance.
0
Valentin.Stoychev
Telerik team
answered on 29 Jun 2009, 01:36 PM
Hi Dan Normington,

In this case you can set the "overflow-x" attribute to "hidden", just like you did with the "overflow" attribute.

Check here for the usage of the overflow attributes:
http://www.brunildo.org/test/Overflowxy2.html

Please let us know how it goes.

Sincerely yours,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dan Normington
Top achievements
Rank 1
answered on 29 Jun 2009, 02:26 PM
Thanks for the reply. Because my data is in xml, I apply a stylsheet prior to binding the html to the placeholder control. What I ended up doing was the following in my xslt. This seems to place the vertical scrollbar perfectly. Thank you very much for your help.

<

 

div style="height:100%;overflow:auto">

 

<

 

xsl:apply-templates/>

</

 

div>

 

Tags
HTMLPlaceHolder
Asked by
Dan Normington
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Dan Normington
Top achievements
Rank 1
Share this question
or