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

RadHtmlPlaceholder throws exception hen used in ItemsControl

2 Answers 55 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Valeriu
Top achievements
Rank 1
Valeriu asked on 29 Sep 2011, 03:59 PM
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 Answers, 1 is accepted

Sort by
0
Valeriu
Top achievements
Rank 1
answered on 29 Sep 2011, 11:28 PM
Forget it, RadHtmlPlaceholder is useless in my scenario...
0
Tina Stancheva
Telerik team
answered on 04 Oct 2011, 08:47 AM
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 >>

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