Floating Text in SharePoint 2010 SL Web Part

4 posts, 0 answers
  1. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 27 Apr 2012 Link to this post

    I have a Silverlight web part that uses the HTMLPlaceHolder to display a SharePoint rich text field's data. The string value is pure HTML. Everything works perfectly until I scroll the SharePoint web page, at which point the HTMLPlaceHolder just floats in position. In addition, I have a RadComboBox next to the HTMLPlaceHolder and when I expand the RadComboBox the HTMLPlaceHoder floats over the RadComboBox... Is there any way around this? The place holders are inside a UserControl's LayoutRoot grid. They are not hosted in a ChildWindow or any other control.
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 02 May 2012 Link to this post

    Hi Robert,

    RadHtmlPlaceholder renders external pages in an IFrame positioned above the Silverlight plugin and therefore all styles applied on the page where the plugin is hosted affect the way the IFrame is rendered. This is the reason why, we have little control over the way the external pages are displayed inside the HtmlPlaceholder.

    However, you can control the ScrollBars visibility/functionality mostly through styles. This is why it would be best if you check the style applied to the page where you add the Silverlight WebPart hosting the HtmlPlaceholder control and modify the overflow properties accordingly to the page's content and your requirements. You can also have a look at this forum post where similar issue is discussed.

    Also due to the implementation of the HtmlPlaceholder and the fact that it renders all external pages in an IFrame positioned above the Silverlight plug-in, the control's content comes on top of all other Silverlight elements - in your case the ComboBox. However, as you say that the HtmlPlaceholder displays rich text data, you can try and replace it with the RadRichTextBox control instead.

    All the best,
    Tina Stancheva
    the Telerik team

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

  3. DevCraft banner
  4. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 02 May 2012 Link to this post

    Whenever I add a RadRichTextBox the Silverlight web part crashes.

    public string _description { get; set; }
    public RadDocument Description
    {
        get
        {
            HtmlFormatProvider provider = new HtmlFormatProvider();
            return provider.Import(_description);
        }
     
    }

    and the binding is 

    <telerik:RadRichTextBox Document="{Binding Description}" Height="95" Margin="5"  />
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 04 May 2012 Link to this post

    Hi Robert,

    The Document property of RadRichTextBox is not a dependency property and cannot be bound. RadRichTextBox uses data providers in order to bind its content to strings in specific file formats - HTML, RTF, XAML, etc. In your case, you can implement the Description property like this:

    private string _description;
    public string Description
    {
        get { return _description; }
        set { _description = value; }
    }

    You may also need to implement the INotifyPropertyChanged, so that the data provider would be notified about changes in the value of the property.

    The XAML should look like this:
    <telerikHtml:HtmlDataProvider
                  RichTextBox="{Binding ElementName=richTextBox}"
                  Html="{Binding Description}" />
    <telerik:RadRichTextBox x:Name="richTextBox" Height="95" Margin="5" />

    I hope this helps.

    All the best,
    Iva Toteva
    the Telerik team

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

Back to Top