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

HTMLSource doesn't display my text

2 Answers 44 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Kamal Mostofi
Top achievements
Rank 1
Kamal Mostofi asked on 24 Jan 2011, 02:04 PM

Hi,
I have a silverlight project that I display pages in a frame. I have a page with HTMLPlaceHolder and in code behind, I add some HTML format text to the HTMLSource. When i run my application, nothing displays on the screen.
Please note I set silverlight plug-in to windowless true.

Can someone help please?
I do appreciate your help.
Thanks,
Kam

<Grid x:Name="LayoutRoot" >
       <Grid.ColumnDefinitions>
           <ColumnDefinition Width="*"></ColumnDefinition>
           <ColumnDefinition Width="10"></ColumnDefinition>
       </Grid.ColumnDefinitions>
       <Grid.RowDefinitions>
           <RowDefinition Height="10"></RowDefinition>
           <RowDefinition Height="*"></RowDefinition>
           <RowDefinition Height="10"></RowDefinition>
       </Grid.RowDefinitions>
       <!--<ScrollViewer x:Name="PageScrollViewer" Grid.Column="0" Grid.Row="1" Style="{StaticResource PageScrollViewerStyle}">-->
            
           <telerik:RadHtmlPlaceholder x:Name="htmlnbspanel" Margin="5"  Background="White" ></telerik:RadHtmlPlaceholder>
       <!--</ScrollViewer>-->
   </Grid>

public Home()
{
    InitializeComponent();
    string strstatement = string.Empty;
    strstatement = "<P >This study is all about understanding the importance of ....... – by connecting together information on actual use of these services with the findings collected by Survey on our opinions and preferences as consumers.";htmlnbspanel.HtmlSource = strstatement;
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 24 Jan 2011, 05:42 PM
Hi Kamal Mostofi,

The HtmlSource is set as expected, however the RadHtmlPlaceHolder is not displayed, because it is placed in a Grid.Row = 0. But the Height of this Row is only 10px, which is insufficient space for the RadHtmlPlaceHolder to be properly displayed.

Can you try setting the Height of the Row to 50px for example:
<Grid x:Name="LayoutRoot" >
       <Grid.ColumnDefinitions>
           <ColumnDefinition Width="*"></ColumnDefinition>
           <ColumnDefinition Width="10"></ColumnDefinition>
       </Grid.ColumnDefinitions>
       <Grid.RowDefinitions>
           <RowDefinition Height="50"></RowDefinition>
           <RowDefinition Height="*"></RowDefinition>
           <RowDefinition Height="10"></RowDefinition>
       </Grid.RowDefinitions>
...
</Grid>

Let us know how it goes.

All the best,
Tina Stancheva
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Kamal Mostofi
Top achievements
Rank 1
answered on 24 Jan 2011, 06:22 PM
Hi Tina,

Thanks for your prompt reply and answer. I do need to slap my face and don't make that kind of mistakes!

Regards,
Kamal
Tags
HTMLPlaceHolder
Asked by
Kamal Mostofi
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Kamal Mostofi
Top achievements
Rank 1
Share this question
or