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

Floating Text in SharePoint 2010 SL Web Part

3 Answers 64 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Robert Kaucher
Top achievements
Rank 2
Robert Kaucher asked on 27 Apr 2012, 06:32 PM
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.

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 02 May 2012, 01:13 PM
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 >>

0
Robert Kaucher
Top achievements
Rank 2
answered on 02 May 2012, 04:03 PM
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"  />
0
Iva Toteva
Telerik team
answered on 04 May 2012, 03:55 PM
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 >>

Tags
HTMLPlaceHolder
Asked by
Robert Kaucher
Top achievements
Rank 2
Answers by
Tina Stancheva
Telerik team
Robert Kaucher
Top achievements
Rank 2
Iva Toteva
Telerik team
Share this question
or