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

HtmlPlaceHolder with Silverlight Scrollviewer

5 Answers 59 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Muthu
Top achievements
Rank 1
Muthu asked on 14 Dec 2011, 03:29 PM
I am trying to use HtmlPlaceHolder with Silverlight ScollViewer. Please Help

5 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 19 Dec 2011, 01:03 PM
Hello Muthu,

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 >>

0
Muthu
Top achievements
Rank 1
answered on 19 Dec 2011, 01:25 PM
Hi Tina,

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
0
Tina Stancheva
Telerik team
answered on 19 Dec 2011, 01:28 PM
Hello 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 >>

0
Muthu
Top achievements
Rank 1
answered on 19 Dec 2011, 01:48 PM
Hi Tina,

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
0
Accepted
Tina Stancheva
Telerik team
answered on 22 Dec 2011, 11:19 AM
Hello 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 >>

Tags
HTMLPlaceHolder
Asked by
Muthu
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Muthu
Top achievements
Rank 1
Share this question
or