HTMLSource doesn't display my text

3 posts, 1 answers
  1. Kamal Mostofi
    Kamal Mostofi avatar
    56 posts
    Member since:
    Jan 2010

    Posted 24 Jan 2011 Link to this post

    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. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Jan 2011 Link to this post

    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>>
  3. DevCraft banner
  4. Kamal Mostofi
    Kamal Mostofi avatar
    56 posts
    Member since:
    Jan 2010

    Posted 24 Jan 2011 Link to this post

    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
Back to Top