.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Displaying data from Enhanced Rich Text field

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint

Iam using a custom list, one of the column datatype of the list is Multiple lines of text with type of text to allow as Enhanced Rich Text. Users in my site can copy any type of data and paste in that list coulmn. I need to display the list data in a webpart same as how it is copied. But after querying the list iam getting all the Style tags. How to avoid this.

For example, i copied the following text in the coulmn as below:

One advantage of using the SPGridView control in SharePoint-based solutions is that it has been integrated with the cascading style sheets that are built into Windows SharePoint Services 3.0. Also, the SPGridView control is heavily.
But after quering the list while displaying, following is the output iam getting. How to avoid the tags:

<div class=ExternalClass70B2A73EC47547F98E72395A66BC565C><div>One advantage of using the <strong>SPGridView</strong> control in SharePoint-based solutions is that it has been integrated with the cascading style sheets that are built into Windows SharePoint Services 3.0. Also, the <strong>SPGridView</strong> control is heavily </div></div>

View Complete Post

More Related Resource Links

Mission Impossible? Use Javascript to Disable a Multi-Line Rich Text Field


Hey Community,

Here's a tough one that I have struggled with and so far have not been able to find an answer for - how do you use Javascript to disable a multi-line rich text field.  I have customized a SP Edit form by adding a CEWP.  In the CEWP I have added the Javascript below (only a partial code sample provided) to disable several fields in the form.  The code works fine for single line text fields but it does not work for multi-line rich text fields.  Any suggestions?

<script language="javascript">
//This runs the function when the form first loads

//This locks the fields the users should not modify
function lockFields()
  var theInputTFTitle = getTagFromIdentifierAndTitle("Input","TextField","Title");
  theInputTFTitle.readOnly = true;
  theInputTFTitle.style.color = 'gray';
  //alert(" Value: " + theInputTFTitle.value);//for testing

   var theInputDDLReplyStatus = getTagFromIdentifierAndTitle("select","DropDownChoice","Reply Status");
  theInputDDLReplyStatus.disabled = true;
  //alert(" Value: " + theInputDDLReplyStatus.value);//for testing

  var theInpu

Rich text field showing html code

I am an end user of Sharepoint. This issue only happens from my computer, not from any other within our organization. What happens is that when I edit an item in Sharepoint that contains a rich text field, HTML code is showing. Like so: <div class=ExternalClassC900CFF4F2BF4312A89133C01A6E3C96> Some text</div> This happens from any web browser. Sharepoint 2007 is used. I have Windows 7 x64. Any idea what is causing this?

SharePoint 2010 Rich Text Editor field

I want to embed iframe tag in Sharepoint 2010 rich html text editor control, but it is simply remove the tags when i save the content. Please let me know how can i do this?

Displaying Rich text with formatting in RDLC file

Hi, I want to display my rich text with formatting in RDLC file. Can anyone please help me with the way out for that? Thanks & Regards, Subalakshmi Vijayarajan.

XML data stored in text field

Hi there, I need to extract XML data stored as text from any number of given rows of a table. The stored XML data typically looks like this: In the ATTRIBUTES field from NODEMEATADATA table <T41><A93>S46 SE Trade &amp; Investment</A93><A35>3284</A35><A84>28 November 2008</A84><A33>S Polkinghorn Bband</A33><A46>S46 0501-KEYF Keyfort Limited</A46><A89>400.68</A89><A90>0</A90><A88>400.68</A88><A66>560200 Broadband</A66><A70>ITAC</A70><A54>N/A</A54><A86 /><A87>Awaiting Posting</A87><A91>Mashudul Karim</A91><A94>Chris Burchell</A94><A92 /></T41> I need to be able to extract the invoice numbers from any number of rows based on a WHERE clause that referes to another column of a date/time format. The invoice numbers are with the <A35>****</A35> tags What I have noticed in the table is that element is not always the same. SOme are <T41> some <T6> or <T7> which I think might have something to do with the document status within the <A87> tags. If possible I need to pick up within multiple elements. I then need to add this to my current simple query: SELECT METAID, CONVERT(VARCHAR(10), CAST(CAST(CREATEDON AS VARCHAR) AS DATETIME), 103) AS 'CREATED', FROM N

RTF documents not displaying in rich text box (word pad) ,but able to open using MS office Word


hi there ,

my application has a rich text box ,where rtf files are opened and processed . 90% of the time am able to load this with out any trouble . but rest 10% of the rtf files are not displayed in the rich text box (though they are able to load )

And also i have observed a weird behavior : IF the number of pages of this rtf files are stripped off (from  100 to 10 ) the same are displayed .

Is there any limit for the the number of pages in RTB (rich text bOx) .

thanks in advance 


Rich text editor for Title field in Publishing site


I have one French publishing site. I want to set one page title like this: see BOTOX trademark here . To show title like this i need to put tag like Product <sup>MC</sup> . Problem is, if i put above tags in title text box at the time of page creation then page title showing Product <sup>MC</sup> not  like above site.


Regards, Sandip Patil, .Net,Sharepoint Developer www.worldofsharepoint.com

enhanced rich text html


Hi, is there any documentation about what specific html tags and attributes may be generated in rich text and enhanced rich text fields?

my blog - Tea Time with Meowkins

how to store rich text box data in sql 2005




i am using rich text box controal please tel me how to store rich text data in sql 2005




Dynamic Data Field template edits - Tooltip text, Dynamic Data Page template edits - field sort


I have an ASP.net website build in VB 2010 web dev pro using 4.0 framework.  Its a dynamic data site and I am having some trouble formating some of the field and page canned templates.

Q1: Field Templates - the tooltip code (TextBox1.ToolTip = Column.Description) is within the ascx.vp pages for each of the field templates.  Where can I update each columns description (as the code references) so the tooptip will be column/field specific.  If its not as straight forward as that, I was trying to write an if/else statement because the tooltip code is set at the field type level (decimal, date, etc) and I want it to be column specific.  example;

if column.value = Financial Impact

then  TextBox1.ToolTip = "enter financial impact in whole dollars"

else TextBox1.ToolTip = "next fields tooltip text"



Loading rtf with image gives "Unrecognized structure in data format 'Rich Text Format'.\r\nParamet


I'm trying to load this rtf into a RichTextBox:

{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\ltrch >> -----------------------------------------------------}{\ltrch \line }{\ltrch >> 19-10-2010 11:22}{\ltrch \line }{\ltrch >> -----------------------------------------------------}{\ltrch \line }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch {\*\shppict{\pict\picwgoal1020\pichgoal1035\pngblip

Changing a Text field to a Rich Text field


Is it possible to change an existing field from a text field to a rich text field?  I see options to change it to an option button, date picker, but rich text isn't available. 

If it's not possible to change the field can a new rich text field be linked to show the info from a previous field?  I created a form for a pilot group and based on feedback want to change fields from text to rich text without losing the information from the previous forms.

Multi-Line, Rich Text Field anomaly


When a user clicks on Edit Item for a previously populated and saved List item in SharePoint Services 3.0, the "edit item page" appears but the rich-text multi-line field is blank ... until it is right clicked on in the white space of the multi-line field, then the content that had been previously saved appears.

Should the user fail to right-click in the white space of the multi-line field before saving the List item again, the content previously saved will be saved over as blank. Only recoverable by version control (if enabled for that List).Not tested on

Office XP or Internet Explorer v6.

Office Pro 2007
Internet Explorer v8
Windows XP SP3
SharePoint Services 3.0 SP2 CUAug2010

Column Setting:
Append Changes to Existing Text = NO (default)
Specify the type of text to allow = Rich Text

I was able to reproduce the issue on different desktops with different List items on different Sites for both MOSS 2007 and WSS 3.0.  Clearing the browser cache doesnt resolve it.  I've proven it to

Rich text field error in web-form



I have a few rich text fields in a browser enabled infopath 2010 form. When I tried to submit it an error apppeared.

Retrieving the COM class factory for component with CLSID {52F5D46F-CBEA-4D07-BCB7-7296853F0CF2} failed due to the following error: 80040154. System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {52F5D46F-CBEA-4D07-BCB7-7296853F0CF2} failed due to the following error: 80040154.
at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventRichTextChange.HtmlToCleanXHtml(String html, Boolean makeDomCompatible)


I deleted all rich text fields the form was submitted successfully.

Is this a bug of Infopath 2010? Is any ways to use rich text fields?


Best Regards,



InfoPath 2003 - Populate Data Field based on text field from secondary/different data source.


I have a form where the main fields are populated based on the results of a query field.
Ex, Main Data (SQL) Source: 

Fruit         Color
Apple       Red
Orange     Orange
Pear         Green
Banana     Yellow

Secondary Data Source (Sharepoint List)
Fruit         Code
Apple        1001
Orange     1002
Pear         1003
Banana     1004

What I would like to do is create form fields that will automatically populate based on the contents of the text field.
Ex,  (text field)   Please enter your fruit of choice:   [ Apple ]

(Field 2 - from main SQL data source)          The color of your fruit is [ RED ]

(Field 3 - from secondary Sharepoint List data source)  Your fruits code is  [ 1001 ]


Any suggestions would be greatly appreciated.

Change data type of library field from Single Line Text to currency


I have an InfoPath 2010 form that has a field listing the amount of currency on a meter. It is a Decimal form in Infopath but publishes to SharePoint as a Single Line of Text.  It will not let me modify the column in SharePoint and it will not let me select the allow edit from the Publishing Wizard.  I need the column as a currency so my Excel Queries work.



displaying the text of a binary field in management studio


I have an xml string stored in a binary field of type 'image' created in C# as follows:

string xmltext="<root>some xml text</root>";
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
byte[] xmltext = encoding.GetBytes(sXML);

I than use ADO to write to a table, storing in a column of type: image.
Everything is fine, but now I want to view original xml string.
Executing the 'select xmldata from sometable' shows the field value as a long string of numbers (I assume the binary data).
Can anyone advice how I can display the orginal text value in management studio?

Baruch Barness

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend