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

Scroll Bar

1 Answer 101 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Mohit Vijay
Top achievements
Rank 1
Mohit Vijay asked on 14 Aug 2009, 04:00 AM
Hi,

I am using HTMLPlaceHolder

Copying my all code below

--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
.xaml page

<

 

navigation:Page xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:shinyRed="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.ShinyRed" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" x:Class="CRI.Contactus"

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

 

 

 

xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"

 

 

 

mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="300"

 

 

 

Title="EVALUATION"

 

 

 

>

 

 

 

 

<Border BorderBrush="#FF000000" CornerRadius="5" BorderThickness="5"

 

 

 

HorizontalAlignment="Center" VerticalAlignment="Center" Background="#FFFFFFFF">

 

 

 

 

<Grid MinHeight="300">

 

 

 

 

<ScrollViewer Margin="10" BorderThickness="0" VerticalScrollBarVisibility="Auto"

 

 

 

HorizontalScrollBarVisibility="Auto">

 

 

 

 

<StackPanel Orientation="Horizontal">

 

 

 

 

<StackPanel>

 

 

 

 

<TextBlock

 

 

 

Text="Display external url as a frame in Silverlight page:"

 

 

 

Margin="0 0 0 10" FontWeight="Bold" FontSize="12"

 

 

 

Foreground="#000000"></TextBlock>

 

 

 

 

<telerik:RadHtmlPlaceholder HorizontalAlignment="Left" Width="400"

 

 

 

Height="300" SourceUrl="http://google.com"

 

 

 

x:Name="RadHtmlPlaceholder1" Visibility="Collapsed" />

 

 

 

 

</StackPanel>

 

 

 

 

<Border Margin="20,0,0,0" Background="#f7f7f7" BorderBrush="#191919"

 

 

 

BorderThickness="1">

 

 

 

 

<StackPanel Margin="10">

 

 

 

 

<TextBlock

 

 

 

Margin="0 0 0 10"

 

 

 

Text="Display Html string inline in Silverlight page:"

 

 

 

FontWeight="Bold" FontSize="12" Foreground="#000000"></TextBlock>

 

 

 

 

<telerik:RadHtmlPlaceholder HorizontalAlignment="Left"

 

 

 

x:Name="RadHtmlPlaceholder2" Width="300" Height="300"

 

 

 

Visibility="Collapsed" />

 

 

 

 

</StackPanel>

 

 

 

 

</Border>

 

 

 

 

</StackPanel>

 

 

 

 

</ScrollViewer>

 

 

 

 

</Grid>

 

 

 

 

</Border>

 

</

 

 

navigation:Page>

 

 



--------------------------------------------------------------------------------------
.vb page

 

Private Sub Contactus_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

 

RadHtmlPlaceholder2.HtmlSource =

 

"You can display <b>any</b> <span style=""color:#FF0000;"">valid</span> <i>html</i> content.<br/> " & vbCr & vbLf & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & " It will be displayed as part of the <a href=""http://silverlight.net"" target=""_blank"">Silverlight</a> page layout and will be rendered from the browser."

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.HtmlSource = RadHtmlPlaceholder2.HtmlSource & RadHtmlPlaceholder2.HtmlSource &

"<br/><br/><br/><br/><br/><br/>"

 

 

RadHtmlPlaceholder2.Visibility = Windows.Visibility.Visible

 

End Sub

 

 


--------------------------------------------------------------------------------------

but still I am not getting vertical scroll bars. HTMLSource is too large then HTMLPlaceHolder height.

any help?

NOTE: Import thing is that solution should work with all browsers.

Mohit

1 Answer, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 17 Aug 2009, 01:08 PM
Hi Mohit,

To solve your issue, all you have to do is do the following right after you set the visibility of the HtmlPlaceholder to visible:

(

RadHtmlPlaceholder2.HtmlPresenter.Children[0] as HtmlElement).SetStyleAttribute("overflow", "auto");

Let me know if this helps.

Greetings,
Tihomir Petkov
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.
Tags
HTMLPlaceHolder
Asked by
Mohit Vijay
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or