RadHtmlPlaceholder throws exception hen used in ItemsControl

3 posts, 0 answers
  1. Valeriu
    Valeriu avatar
    21 posts
    Member since:
    Dec 2010

    Posted 29 Sep 2011 Link to this post

    Initial data:
     - Telerik Silverlight  2011.2 920
     - OOB mode

    We're using the HtmlPlaceholder in a item's data template in a ItemsControl.

    The code:
    <ItemsControl x:Name="News"
                  Foreground="White"
                  Margin="0,-3,0,3"
                  Grid.RowSpan="2">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Grid Margin="0 0 0 10">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Title}"
                               FontSize="14"
                               FontWeight="Bold"
                               TextTrimming="WordEllipsis" />
                    <Controls:RadHtmlPlaceholder Grid.Row="1" 
                                                 HtmlSource="{Binding Description}" 
                                                 RespectSilverlightLayoutMeasure="True"
                                                 />
                </Grid>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
        <ItemsControl.Template>
            <ControlTemplate>
                <ScrollViewer VerticalScrollBarVisibility="Auto"
                              BorderThickness="0">
                    <ItemsPresenter />
                </ScrollViewer>
            </ControlTemplate>
        </ItemsControl.Template>
    </ItemsControl>

    When screen is loaded It throws an exception:

    System.InvalidOperationException: MeasureOverride of element 'Telerik.Windows.Controls.RadHtmlPlaceholder' should not return PositiveInfinity or NaN as its DesiredSize.
        at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

    Any hints? Can   RadHtmlPlaceholder be used in a DataTemplate?

    Thanks
  2. Valeriu
    Valeriu avatar
    21 posts
    Member since:
    Dec 2010

    Posted 29 Sep 2011 Link to this post

    Forget it, RadHtmlPlaceholder is useless in my scenario...
  3. DevCraft banner
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 04 Oct 2011 Link to this post

    Hello Valeriu,

    I am not sure what is your scenario, but the RadRichTextBox control supports Html content so you can use it instead of the RadHtmlPlaceholder in your scenario.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top