5 Answers, 1 is accepted
I am not sure what is your scenario and how would you like to integrate the two controls. Basically you can wrap the RadHtmlPlaceholder in a ScrollViewer control but you need to keep in mind that an element with no explicitly set size would not stretch within a ScrollViewer since it provides infinitely large space to its children.
This is why you can either set explicit size to the HtmlPlaceholder when used in a ScrollViewer, or not place it in a ScrollViewer, since if there is not enough available space for rendering its content, the HtmlPlaceholder will automatically show its built-in ScrollViewer.
Also if you've encountered any specific issues with placing the HtmlPlaceholder in a ScrollViewer, please let us know so that we can look into that and further assist you.
Best wishes,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I have tried using only the HtmlPlaceHolder without Scrollviewer, but when the space is not enough to display the rendered content, it shows a default html scrollbar. It degrades the look and feel of a Rich Internet Application. Kindly suggest a resolution.
Thanks,
Muthu
Thank you for getting back to us. Have you encountered any issues while displaying the RadHtmlPlaceholder in the Silverlight ScrollViewer or am I missing something from your scenario?
Also, can you share with us what content you're displaying in the HtmlPlaceholder?
All the best,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Below is the xaml code i m writing,
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Height="34" HorizontalAlignment="Center" Margin="20" Click="Button_Click"
Content="Set the Source of the RadHTMLPlaceHolder" VerticalAlignment="Top"
Width="290" />
<ScrollViewer HorizontalAlignment="Stretch" Height="700" Width="400" VerticalAlignment="Stretch" Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<telerik:RadHtmlPlaceholder HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Silver" x:Name="html"/>
</ScrollViewer>
</Grid>
I would like to set height and width to ScrollViewer, not for the RadHtmlPlaceHolder.
Since the radHtmlPlaceHolder has no explicit height and Width i am getting the screen as the one attached.
Thanks,
Muthu
Since in a ScrollViewer control an element with no explicitly set size would not stretch within a ScrollViewer since it provides infinitely large space to its children.
This is why if you want to stretch the RadHtmlPlaceholder to takes up the ScrollViewer size and control only the ScrollViewer size, you can bind the RadHtmlPlaceholder Width and Height properties to the Width/Height properties of the ScrollViewer.
<
ScrollViewer
Name
=
"scrollViewer"
Grid.Row
=
"1"
Width
=
"400"
Height
=
"700"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
HorizontalScrollBarVisibility
=
"Visible"
>
<
telerik:RadHtmlPlaceholder
x:Name
=
"html"
Width
=
"{Binding ElementName=scrollViewer,Path=Width}"
Height
=
"{Binding ElementName=scrollViewer,Path=Height}"
Background
=
"Silver"
/>
</
ScrollViewer
>
All the best,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>