I have an application page with 2 RadEditors on it.
People enter content in one of the two and by clicking a button they submit the content to a Note field in SharePoint 2010( which is rich text, not enhanced rich text). Submission is done via C# custom code.
My issue is that when I try to set the value of the field font name, font size, underline, font color and back color are stripped down in the field. My guess is that the field does not accept XHtml (correct my if I am wrong) so when I try to set the field value with the content :
<span style="font-family: Arial; font-size: 48px;"><strong><em><span style="background-color: #ffff00; color: #ff0000; text-decoration: underline;">test</span></em></strong></span> which comes from RadEditor, some of these value do not get converted to something like:
<font style="background-color:#ffff00" color="#ff0000" size="7" face="Arial"><strong><em><u>Anisia 567</u></em></strong></font> that the field is expecting.
This behavior is occuring with both of my RadEditors.
The configuration of editor is as follows:
<telerik:RadEditor runat="server" ID="TextBoxRich" EmptyMessage="msg1" Height="67px" Width="100%" BackColor="#dae4f1" CssClass="noteTextBox" BorderColor="Black" ToolTip="msg2">
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="FontName"/>
<telerik:EditorTool Name="FontSize"/>
<telerik:EditorTool Name="Bold"/>
<telerik:EditorTool Name="Italic"/>
<telerik:EditorTool Name="Underline"/>
<telerik:EditorTool Name="JustifyLeft"/>
<telerik:EditorTool Name="JustifyCenter"/>
<telerik:EditorTool Name="JustifyRight"/>
<telerik:EditorTool Name="InsertOrderedList"/>
<telerik:EditorTool Name="InsertUnorderedList"/>
<telerik:EditorTool Name="Outdent"/>
<telerik:EditorTool Name="Indent"/>
<telerik:EditorTool Name="ForeColor"/>
<telerik:EditorTool Name="BackColor"/>
</telerik:EditorToolGroup>
</Tools>
</telerik:RadEditor>
and in ShaPoint I set the value as follows:
SPFieldMultiLineText field = (SPFieldMultiLineText)Item.Fields["Note"];
field.ParseAndSetValue(newItem, TextBoxRich.Content);
Any suggestion is greatly appreciated.
Thank you.
Best regards,
Anisia Pop